I tried to create Unique columns in my database with Index but it is not working.It creates everything else but not Email and SSN just leaves as normal columns. Is there some other way to create Unique columns.
[StringLength(40)]
[Index("IX_PIndex", 2, IsUnique = true)]
public string Email { get; set; }
[StringLength(20)]
[Index("IX_PIndex", 1, IsUnique = true)]
public string SSN { get; set; }