Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 protected BaseController()
 {
     Context = new DwContext();
 }