Exemplo n.º 1
0
        public Task <TUser> FindByNameAsync(string userName)
        {
            if (string.IsNullOrEmpty(userName))
            {
                throw new ArgumentException("Null or empty argument: userName");
            }

            TUser result = IdentityUserRepository.GetByUserName(userName) as TUser;

            // Should I throw if > 1 user?
            if (result != null)
            {
                return(Task.FromResult <TUser>(result));
            }

            return(Task.FromResult <TUser>(null));
        }