コード例 #1
0
 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));
     }
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 public async Task <IActionResult> Get([FromQuery] BrowseUserQuery query)
 => Collection(await _adminService.BrowseUsersAsync(query));
コード例 #4
0
 public async Task <ActionResult <IEnumerable <UserDto> > > Get([FromQuery] BrowseUserQuery query)
 => Ok(await _dispatcher.QueryAsync(query));