首页 > 其他 > 详细

EF唯一索引

时间:2016-09-21 22:55:01      阅读:368      评论:0      收藏:0      [点我收藏+]
this.Property(p => p.Name)
                .IsRequired()
                .HasMaxLength(new int?(50))
                .HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("UX_Role_Name") { IsUnique=true}));
using System.ComponentModel.DataAnnotations.Schema;

[Index(IsUnique = true)]

 

EF唯一索引

原文:http://www.cnblogs.com/shiningrise/p/5894205.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!