Пример #1
0
        public StoredUserInformation GetStoredCredentials(LoginCredentials enteredCredentials)
        {
            if (enteredCredentials == null)
            {
                throw new ArgumentNullException(nameof(enteredCredentials));
            }

            var userAccount = GetUserAccount(enteredCredentials);

            if (userAccount == null)
            {
                return(null);
            }

            return(new StoredUserInformation {
                SerializedCredentials = userAccount.SerializedCredentials,
                UserInformation = new UserInformation(userAccount.GetIdentity(), userAccount.Username),
            });
        }
Пример #2
0
 User GetUserAccount(LoginCredentials enteredCredentials)
 {
     return(query.Query <User>().SingleOrDefault(x => x.Username == enteredCredentials.Username));
 }