例如有如下model
public class Emp
{
public int Id { get; set; }
[MaxLength(10)]
public string EmpNo { get; set; }
[MaxLength(10)]
public string Alias { get; set; }
public int Level { get; set; } // 怎么给这个字段建索引?
}
------解决方案--------------------
新建的项目也是用add-migration,然后update-database