Пример #1
0
        public void Login(string userName)
        {
            var userRecord = userStore.GetUserByName(userName);
            var user       = userTranslator.Translate(userRecord);

            cacheUserStore.SetUser(user);
        }
Пример #2
0
        public async Task <UserDto> GetByUsername(string username)
        {
            var dbUser = await DatabaseContext.Users
                         .FirstOrDefaultAsync(u => u.Username == username);

            return(UserTranslator.Translate(dbUser));
        }
Пример #3
0
        public async Task <IEnumerable <User> > LoadUsers()
        {
            var userEntities = await _userRepository.FindAll();

            var users = UserTranslator.Translate(userEntities);

            return(users);
        }
Пример #4
0
        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);
        }