开发者

String in Unique Key in Entity Framework

Is it possible to put a string in Unique Key ?

    public int ID{ get; set; }

    public string TweetID { get; set; }

Because I need ID in primary key (it's ok) and TweetID in unique key (for no duplication in database)

EDI开发者_如何学运维T : I use Entity Framework 4 and MVC3


It is possible to define unique key on string column but you must do it in the database (as unique index) because none of current EF versions support unique keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜