public async Task <Unit> Handle(CheckAvailabilityCommand request, CancellationToken cancellationToken)
        {
            var websites = await _websiteRepository.GetAllAsync();

            var tasks = websites.Select(UpdateStatus).ToList();

            await Task.WhenAll(tasks);

            return(Unit.Value);
        }
コード例 #2
0
        public async Task <IEnumerable <Website> > Handle(WebsiteGetQuery request, CancellationToken cancellationToken)
        {
            var sites = await _websiteRepository.GetAllAsync();

            return(sites.OrderBy(x => x.Id).Adapt <IEnumerable <Website> >());
        }