First off, I'm new to MVC.
I have a Project table in which there are ProjectID, ProjectNumber and ProjectDescription fields. ProjectId is an entityKey of type int, ProjectNumber must be a unique constraint.
How to do this in the infrastructure of entity 6.1.3?
in my class Project I have
public int ProjectID { get; set; }
[Index(IsUnique = true)]
[StringLength(200)]
public string ProjectNumber { get; set; }
public string ProjectDescription { get; set; }
when I create the database from the model, the field is not set as unique in the database.
what am I doing wrong?
source
share