How to: Unique Constraint in Entity Framework Code First
How to: Unique Constraint in Entity Framework Code First
Unique Constraint in Entity Framework Code First
Question
Is it possible to define a unique constraint on a property using either the fluent syntax or an attribute? If not, what are the workarounds?
I have a user class with a primary key, but I would like to make sure the email address is also unique. Is this possible without editing the database directly?
Solution (based on Matt’s answer)
publi…
View On WordPress












