Amss.Boilerplate.Api.Common.Adapters.ServiceStackCredentialsAuthAdapter.FindByPasswordCredential C# (CSharp) Method

FindByPasswordCredential() private method

private FindByPasswordCredential ( string login, string password ) : ServiceStack.ServiceInterface.Auth.UserAuth
login string
password string
return ServiceStack.ServiceInterface.Auth.UserAuth
        private UserAuth FindByPasswordCredential(string login, string password)
        {
            UserAuth userAuth = null;
            using (new UnitOfWork())
            {
                var manager = this.container.Resolve<IUserManager>();
                var user = manager.FindByPasswordCredential(login, password);
                if (user != null)
                {
                    userAuth = new UserAuth
                        {
                            RefIdStr = user.Id.ToString(CultureInfo.InvariantCulture),
                            UserName = login,
                            Email = user.Email,
                            DisplayName = user.Name,
                            Roles = new List<string>(),
                            Permissions = new List<string>(),
                        };
                    if (user.Role != null)
                    {
                        userAuth.Roles.Add(user.Role.Name);
                        userAuth.Permissions.AddRange(from p in user.Role.Permissions select p.Name.ToString());
                    }
                }
            }

            return userAuth;
        }