<分区>
我有这门课:
public class BSC
{
public int BSCId { get; set; }
public string BSCName { get; set; }
}
和配置类:
public class BSCConfig :EntityTypeConfiguration<BSC>
{
public BSCConfig()
{
Property(m => m.BSCName).HasMaxLength(50).HasColumnName("Category").IsRequired();
}
}
我想使这个属性成为唯一的,但我没有 isUnique 或 Index 方法。
你能告诉我如何使这个属性独一无二吗?