Example #1
0
        public async Task <RepairData> Extract(HouseSummery summery)
        {
            var commonTask  = commonDataExtractor.Extract(summery.PasportUri);
            var serviceTask = houseServicesByYearDataExtractor.Extract(summery.ServicesUri);

            await Task.WhenAll(commonTask, serviceTask);

            return(new RepairData
            {
                House = commonTask.Result,
                ServicesByYear = serviceTask.Result
            });
        }
Example #2
0
        public async Task <RepairData> Extract(HouseSummery summery)
        {
            var commonTask  = commonDataExtractor.Extract(summery.PasportUri);
            var serviceTask = houseServicesByYearDataExtractor.Extract(summery.ServicesUri);

            await Task.WhenAll(commonTask, serviceTask);

            var data = new RepairData
            {
                House          = commonTask.Result,
                ServicesByYear = serviceTask.Result
            };

            var id = summery.PasportUri.Segments.Last();
            await addressInfoRepository.Save(id, data);

            return(data);
        }