sharding/samples/Sample.SqlServer/Domain/Maps/SysTestMap.cs

17 lines
593 B
C#
Raw Permalink Normal View History

2021-03-08 14:59:32 +08:00
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Sample.SqlServer.Domain.Entities;
namespace Sample.SqlServer.Domain.Maps
2021-03-08 14:59:15 +08:00
{
2021-03-08 14:59:32 +08:00
public class SysTestMap:IEntityTypeConfiguration<SysTest>
2021-03-08 14:59:15 +08:00
{
2021-03-08 14:59:32 +08:00
public void Configure(EntityTypeBuilder<SysTest> builder)
{
builder.HasKey(o => o.Id);
2022-08-17 10:58:49 +08:00
builder.Property(o => o.Id).ValueGeneratedOnAdd().IsRequired().HasMaxLength(128);
2021-03-08 14:59:32 +08:00
builder.Property(o => o.UserId).IsRequired().HasMaxLength(128);
builder.ToTable(nameof(SysTest));
}
2021-03-08 14:59:15 +08:00
}
}