This question already has an answer here:
- Unique key with EF code first 5 answers
If I have class
public class Hotel
{
public int Id { get; set; }
public string Name { get; set; }
...
}
how can set unique constraint on Name property using code first approach?
Aucun commentaire:
Enregistrer un commentaire