private DtoUser SearchUser(string userToSearch) { var user = new DtoUser(); using (RepositoryUser model = new RepositoryUser()) { user = model.Read().FirstOrDefault(registro => registro.Email == userToSearch); } if (user != null) { return(user); } return(null); }
private bool AlreadyRegistered(DtoUser user) { var lista = new List <DtoUser>(); using (RepositoryUser model = new RepositoryUser()) { lista = model.Read(); } foreach (var registro in lista) { if (user.Email == registro.Email) { return(true); } } return(false); }