private BackupObject GetBackupObject(Action <ExportImportProgressInfo> progressCallback)
        {
            progressCallback(new ExportImportProgressInfo("The fulfilmentCenters are loading"));
            var centers = _fulfillmentCenterSearchService.SearchCenters(new FulfillmentCenterSearchCriteria {
                Take = int.MaxValue
            }).Results;

            progressCallback(new ExportImportProgressInfo("Evaluation the number of inventory records"));

            var searchResult = _inventorySearchService.SearchInventories(new InventorySearchCriteria {
                Take = BatchSize
            });
            var totalCount  = searchResult.TotalCount;
            var inventories = searchResult.Results.ToList();

            for (int i = BatchSize; i < totalCount; i += BatchSize)
            {
                progressCallback(new ExportImportProgressInfo($"{i} of {totalCount} inventories have been loaded"));
                searchResult = _inventorySearchService.SearchInventories(new InventorySearchCriteria {
                    Skip = i, Take = BatchSize
                });
                inventories.AddRange(searchResult.Results);
            }

            return(new BackupObject()
            {
                InventoryInfos = inventories.ToArray(),
                FulfillmentCenters = centers.ToArray()
            });
        }
        public GenericSearchResult <InventoryInfo> SearchInventories(InventorySearchCriteria criteria)
        {
            var cacheKey = GetCacheKey("IInventorySearchService.SearchInventories", criteria.GetCacheKey());
            var retVal   = _cacheManager.Get(cacheKey, RegionName, () => _inventorySearchService.SearchInventories(criteria));

            return(retVal);
        }