public async Task <User> FindByUsername(string username, GibsonUserType userType, Guid clientId) { if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException(nameof(username)); } if (clientId == Guid.Empty) { throw new ArgumentNullException(nameof(clientId)); } var result = await repo.GetUserByUserName(username, userType, clientId); return(result); }
public async Task <User> GetUserByUserName(string username, GibsonUserType userType, Guid clientId) { var results = await collection.FindAsync(x => x.Username == username && x.ClientId == clientId && x.UserType == userType); return(await results.FirstOrDefaultAsync()); }