public async Task<User> RegistrateUser(User user) { if (user != null) { _dbContext.Users.Add(user); await _dbContext.SaveChangesAsync(); return user; } return null; }
public async Task<User> ValidateUser(User user) { var findedUser = await _dbContext.Users.FirstOrDefaultAsync(r => r.Surname == user.Surname && r.Password == user.Password); return findedUser; }