Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CTP5 in Model Class ,How add the Attribute to Make a field of Unique?

C#
public class Category
{
    public string CategoryId { get; set; }
    [Unique]? //like this ,How to Add.
    public string Name { get; set; }

    public virtual ICollection<Product> Products { get; set; }
}
Posted
Updated 7-Aug-11 17:27pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900