Wondering if Entity Framework 5 supports unique constraints on entity properties? If so, how can I specify that a property should be unique?
Wondering if Entity Framework 5 supports unique constraints on entity properties? If so, how
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it doesn’t. There were plans in the past to include a unique constraint feature in EF 5.0:
http://blogs.msdn.com/b/efdesign/archive/2011/03/09/unique-constraints-in-the-entity-framework.aspx
But you can see that there is an update on top of the post:
You can vote on the feature to raise possibly the priority it gets implemented with…
http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/1050579-unique-constraint-i-e-candidate-key-support
…because apparently it isn’t even on the roadmap for EF 6.0 at the moment:
http://entityframework.codeplex.com/wikipage?title=Roadmap