EF 索引
public class CustomerMap : EntityTypeConfiguration<Customer> { public CustomerMap() { this.Property(o => o.UserName).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute() { IsUnique = true })); } }
public class CustomerMap : EntityTypeConfiguration<Customer> { public CustomerMap() { this.Property(o => o.UserName).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute() { IsUnique = true })); } }