public async Task Run(CacheCustomersForCaretakerRequest request) { var caretaker = await _unitOfWork.Repository.GetByGuidAsync(request.CaretakerGuid, $"{nameof(Caretaker.TakingCareOf)}.{nameof(CaretakerForCustomer.Customer)}"); var tasks = caretaker.TakingCareOf.Select(x => _applianceService.CacheCustomerApplianceHistory(x.Customer.Guid)); await Task.WhenAll(tasks); }
public async Task Run(CacheCustomerApplianceHistoryRequest request) { await _applianceService.CacheCustomerApplianceHistory(request.CustomerGuid); }
public void ScheduleTask(Guid customerGuid) { _taskService.EnqueueTask(() => _applianceService.CacheCustomerApplianceHistory(customerGuid)); }