public virtual async Task <CatalogContentArgument> Process(CommerceContext commerceContext, Catalog catalog)
 {
     using (CommandActivity.Start(commerceContext, this))
     {
         var arg = new SynchronizeCatalogArgument()
         {
             ImportCatalog = catalog
         };
         return(await _synchronizeCatalogPipeline.Run(arg, new CommercePipelineExecutionContextOptions(commerceContext)));
     }
 }
Exemplo n.º 2
0
        protected override async Task <MinionRunResultsModel> Execute()
        {
            var arg = new SynchronizeCatalogArgument();

            var policy = MinionContext.GetPolicy <SynchronizeCatalogPolicy>();

            arg.Options.ExcludeLogInResults = policy.ExcludeLogInResults;
            arg.Options.SkipRelationships   = policy.SkipRelationships;

            var result = await Pipeline.Run(arg, new CommercePipelineExecutionContextOptions(MinionContext)).ConfigureAwait(false);

            var runResults = new MinionRunResultsModel {
                ItemsProcessed = result.TotalNumberOfEntitiesEffected, DidRun = true
            };

            return(runResults);
        }
Exemplo n.º 3
0
        public async Task <SynchronizeCatalogResult> Run(SynchronizeCatalogArgument arg)
        {
            _synchronizeCatalogArgument = arg;
            _synchronizeCatalogResult   = new SynchronizeCatalogResult();
            Log("Starting Simple Catalog Import Service Run");

            await ImportProductsAndVariants().ConfigureAwait(false);
            await ImportCatalogs().ConfigureAwait(false);
            await ImportCategories().ConfigureAwait(false);

            if (arg.Options.SkipRelationships == false)
            {
                await ImportRelationships().ConfigureAwait(false);
            }

            Log("Ending Simple Catalog Import Service Run");
            return(_synchronizeCatalogResult);
        }
Exemplo n.º 4
0
        public async Task <SynchronizeCatalogResult> Process(CommerceContext commerceContext, SynchronizeCatalogArgument arg)
        {
            using (var activity = CommandActivity.Start(commerceContext, this))
            {
                var result = await _commander.Pipeline <ISynchronizeCatalogPipeline>().Run(arg, new CommercePipelineExecutionContextOptions(commerceContext)).ConfigureAwait(false);

                return(result);
            }
        }