添加命令数据验证和其他杂项修改

This commit is contained in:
2021-02-24 16:28:08 +08:00
parent 12ecdf3159
commit 41794aa1bc
32 changed files with 310 additions and 484 deletions

View File

@@ -14,9 +14,10 @@ namespace Infrastructure.EntityConfigurations
public void Configure(EntityTypeBuilder<Link> builder)
{
builder.ToTable("Link");
builder.HasKey(l => l.Id);
builder.HasIndex(l => l.ShortCode).IsUnique();
builder.Ignore(l => l.DomainEvents);
builder.HasIndex(l => l.ShortCode).IsUnique();
builder.HasKey(l => l.Id);
builder.Property(l => l.Id).ValueGeneratedOnAdd().IsRequired();
builder.Property(l => l.AppId).IsRequired();
builder.Property(l => l.ShortCode).HasMaxLength(11);
}