public Manager SignInManager(string name, string password) { List <Manager> getManagers = repo.GetAllManagers(); foreach (var manager in getManagers) { if ((manager.Name.Equals(name)) && (manager.Password.Equals(password))) { return(repo.SignInManager(name, password)); } else { Log.Error($"Invalid Login. Name: {name} Password: {password}"); throw new Exception("\nInvalid Name/Password. Please try again"); } } return(repo.SignInManager(name, password)); }