protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var db = new DwContext(); var user = db.Users.FirstOrDefault(u => u.Email == (string)value); return user == null ? ValidationResult.Success : new ValidationResult("Mail already exists"); }
protected BaseController() { Context = new DwContext(); }