Esempio n. 1
0
        public async Task <IEnumerable <HostDto> > Handle(GetAllHostsQuery request, CancellationToken cancellationToken)
        {
            var query = await this.context.Hosts.Where(h => !h.IsDeleted).ToListAsync(cancellationToken).ConfigureAwait(false);

            return(query.Select(h => new HostDto(h)));
        }
        public async Task <IEnumerable <HostDto> > Handle(GetAllHostsQuery request, CancellationToken cancellationToken)
        {
            var query = await this.context.Users.Find(u => u.RoleName == RoleNames.Host).ToListAsync(cancellationToken).ConfigureAwait(false);

            return(query.Select(h => CustomMapper.Map <HostDto>(h)));
        }