public void Login(string userName) { var userRecord = userStore.GetUserByName(userName); var user = userTranslator.Translate(userRecord); cacheUserStore.SetUser(user); }
public async Task <UserDto> GetByUsername(string username) { var dbUser = await DatabaseContext.Users .FirstOrDefaultAsync(u => u.Username == username); return(UserTranslator.Translate(dbUser)); }
public async Task <IEnumerable <User> > LoadUsers() { var userEntities = await _userRepository.FindAll(); var users = UserTranslator.Translate(userEntities); return(users); }
public async Task <UserDto> GetByUsernameAndPassword(string username, string password) { var dbUser = await(DatabaseContext.Users .FirstOrDefaultAsync(u => u.Username == username && u.Password == password && password != "")); var user = UserTranslator.Translate(dbUser); return(user); }