public override bool IsValid(object value) { using (BoVoyageDbContext db = new BoVoyageDbContext()) { return(!db.Clients.Any(x => x.Mail == value.ToString())); } }
public override bool IsValid(object value) { if (value != null && value is string) { using (BoVoyageDbContext db = new BoVoyageDbContext()) { return(!db.Commercials.Any(x => x.Login == value.ToString())); } } return(true); }