public override async Task ProcessActivityAsync(IStatus status)
        {
            var updateProductsTask = await statusController.CreateAsync(status, $"Update {updateTypeDescription}");

            // We'll limit detail updates to user specified ids.
            // if user didn't provide a list of ids - we'll use the details gaps
            // (ids that exist in master list, but not detail) and updated
            var productsUpdateList = await itemizeUserRequestedOrDefaultAsyncDelegate.ItemizeAllAsync(updateProductsTask);

            var currentProduct = 0;

            foreach (var id in productsUpdateList)
            {
                var product = await masterDataController.GetByIdAsync(id, updateProductsTask);

                if (product == null)
                {
                    continue;
                }

                await statusController.UpdateProgressAsync(
                    updateProductsTask,
                    ++currentProduct,
                    productsUpdateList.Count(),
                    product.Title);

                var updateIdentity = getUpdateIdentityDelegate.GetUpdateIdentity(product);
                if (string.IsNullOrEmpty(updateIdentity))
                {
                    continue;
                }

                var uri = string.Format(
                    getUpdateUriDelegate.GetUpdateUri(context),
                    updateIdentity);

                var data = await getDeserializedDelegate.GetDeserializedAsync(updateProductsTask, uri);

                if (data != null)
                {
                    fillGapsDelegate?.FillGaps(data, product);
                    await detailDataController.UpdateAsync(data, updateProductsTask);
                }
            }

            await detailDataController.CommitAsync(updateProductsTask);

            await statusController.CompleteAsync(updateProductsTask);
        }
        public override async Task ProcessActivityAsync(IStatus status)
        {
            var updateAllProductsTask = await statusController.CreateAsync(status, $"Update {activityContext.Item2}");

            var activityContextString = activityContextController.ToString(activityContext);

            await activityRecordsController.SetRecordAsync(activityContextString, RecordsTypes.Started, updateAllProductsTask);

            var productsPageResults = await getPageResultsAsyncDelegate.GetPageResultsAsync(updateAllProductsTask);

            var extractTask = await statusController.CreateAsync(updateAllProductsTask, $"Extract {activityContext.Item2}");

            var newProducts = itemizePageResultsDelegate.Itemize(productsPageResults);
            await statusController.CompleteAsync(extractTask);

            if (newProducts.Any())
            {
                var updateTask = await statusController.CreateAsync(updateAllProductsTask, $"Save {activityContext.Item2}");

                var current             = 0;
                var updateProgressEvery = 10;

                foreach (var product in newProducts)
                {
                    if (++current % updateProgressEvery == 0)
                    {
                        await statusController.UpdateProgressAsync(updateTask, current, newProducts.Count(), product.Title);
                    }

                    await dataController.UpdateAsync(product, updateTask);
                }

                await statusController.CompleteAsync(updateTask);
            }

            await activityRecordsController.SetRecordAsync(activityContextString, RecordsTypes.Completed, updateAllProductsTask);

            await dataController.CommitAsync(updateAllProductsTask);

            await statusController.CompleteAsync(updateAllProductsTask);
        }
 public async Task CommitAsync(IStatus status)
 {
     await productRecordsController.CommitAsync(status);
 }