public async Task <PagedResult <User> > BrowseAsync(BrowseUserQuery query) { if (string.IsNullOrEmpty(query.EmailDomain)) { return(await BrowseAsync(u => 1 == 1, query)); } else { return(await BrowseAsync(u => u.Email.Contains(query.EmailDomain), query)); } }
public async Task <PagedResult <UserDto> > HandleAsync(BrowseUserQuery query) { var pagedResult = (PagedResult <User>)null; if (Shared.UseSql) { pagedResult = await _userEFRepository.BrowseAsync(query); } else { pagedResult = await _userMongoRepository.BrowseAsync(query); } var users = pagedResult.Items.Select(u => new UserDto { Id = u.Id, Email = u.Email, Role = u.Role, LastLogin = u.LastLogin, Guid = u.Guid }); return(PagedResult <UserDto> .From(pagedResult, users)); }
public async Task <IActionResult> Get([FromQuery] BrowseUserQuery query) => Collection(await _adminService.BrowseUsersAsync(query));
public async Task <ActionResult <IEnumerable <UserDto> > > Get([FromQuery] BrowseUserQuery query) => Ok(await _dispatcher.QueryAsync(query));