An existing DB schema has unique, non-primary, keys, and some foreign keys that rely on them.
Is it possible to define unique keys, which are not primary keys, in
You can use DataAnnotations validation as well.
I've created this (UniqueAttribute) class, that inherits ValidationAttribute, and when applied to a property, the values of that column will be retrieved and validated against, during validation.
UniqueAttribute
ValidationAttribute
You can grab the raw code from here.