Entity framework MVC4唯一字段模型
我一直在谷歌上搜索这个,没有任何乐趣 如何在mvc4.net中的代码优先方法中向字段添加uniqueEntity framework MVC4唯一字段模型,entity-framework,ef-code-first,Entity Framework,Ef Code First,我一直在谷歌上搜索这个,没有任何乐趣 如何在mvc4.net中的代码优先方法中向字段添加unique public class Religion { public int ReligionId { get; set; } [Required] [StringLength(200)] public string Description { get; set; } } 我需要在说明中添加哪些内容才能使其工作您可以
public class Religion
{
public int ReligionId { get; set; }
[Required]
[StringLength(200)]
public string Description { get; set; }
}
我需要在说明中添加哪些内容才能使其工作您可以使用远程验证 回顾这一联系 简捷