using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace ShardingCoreBenchmark5x { internal class OrderMap:IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(o => o.Id); builder.Property(o => o.Id).IsUnicode(false).HasMaxLength(50); builder.Property(o => o.Body).IsRequired().HasDefaultValue(string.Empty).HasMaxLength(128); builder.Property(o => o.Remark).IsRequired().HasDefaultValue(string.Empty).HasMaxLength(128); builder.Property(o => o.Payer).IsRequired().IsUnicode(false).HasMaxLength(50); builder.Property(o => o.OrderStatus).HasConversion(); builder.ToTable(nameof(Order)); } } }