2021-12-01 15:52:42 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
|
|
|
|
namespace ShardingCore6x
|
|
|
|
|
{
|
|
|
|
|
internal class OrderMap:IEntityTypeConfiguration<Order>
|
|
|
|
|
{
|
|
|
|
|
public void Configure(EntityTypeBuilder<Order> builder)
|
|
|
|
|
{
|
|
|
|
|
builder.HasKey(o => o.Id);
|
2022-07-12 10:29:31 +08:00
|
|
|
|
builder.Property(o => o.Id).ValueGeneratedOnAdd().IsUnicode(false).HasMaxLength(50);
|
2021-12-01 15:52:42 +08:00
|
|
|
|
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<int>();
|
|
|
|
|
builder.ToTable(nameof(Order));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|