private bool LoginUser(string username, string password)
 {
     if (APIInterface.IsValidUser(new User {
         username = username, password = password
     }))
     {
         return(true);
     }
     return(false);
 }
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            UserLogin userLogin = (UserLogin)validationContext.ObjectInstance;

            User user = new User()
            {
                username = userLogin.username, password = userLogin.password
            };

            if (!APIInterface.IsValidUser(user))
            {
                return(new ValidationResult("Invalid password"));
            }

            return(ValidationResult.Success);
        }