¿Cómo puedo definir que en el campo Email no pueden repetirse las direcciones de correo electrónicas?
Mi clase:
namespace BusinessWebApi.Models
{
[Table("UserApi")]
public class UserApi
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column(Order = 1, TypeName = "INT")]
public int Id { get; set; }
[Column(Order = 2, TypeName = "VARCHAR")]
[StringLength(50)]
public string Email { get; set; }
[Column(Order = 3, TypeName = "VARCHAR")]
[StringLength(200)]
public string Password { get; set; }
[Column(Order = 4, TypeName = "DATETIME")]
public DateTime CreateDate { get; set; }
}
}