Reputation: 7057
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)
EDIT : I use Entity Framework 4 and MVC3
Upvotes: 0
Views: 677
Reputation: 364269
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.
Upvotes: 1