コード例 #1
0
        public IBulkAction Create(BulkActionContext context)
        {
            IBulkAction result = null;

            switch (context)
            {
            case CategoryChangeBulkActionContext changeCategoryActionContext:
                result = new CategoryChangeBulkAction(_lazyLazyServiceProvider, changeCategoryActionContext);
                break;

            case PropertiesUpdateBulkActionContext updatePropertiesActionContext:
                result = new PropertiesUpdateBulkAction(_lazyLazyServiceProvider, updatePropertiesActionContext);
                break;
            }

            return(result ?? throw new ArgumentException($"Unsupported action type: {context.GetType().Name}"));
        }
        public IBulkAction Create(BulkActionContext context)
        {
            IBulkAction result = null;

            switch (context)
            {
            case CategoryChangeBulkActionContext changeCategoryActionContext:
                result = new CategoryChangeBulkAction(changeCategoryActionContext, _catalogService, _categoryListEntryMover, _productListEntryMover);
                break;

            case PropertiesUpdateBulkActionContext updatePropertiesActionContext:
                result = new PropertiesUpdateBulkAction(updatePropertiesActionContext, _itemService, _bulkPropertyUpdateManager);
                break;
            }

            return(result ?? throw new ArgumentException($"Unsupported action type: {context.GetType().Name}"));
        }
コード例 #3
0
        public IDataSource Create(BulkActionContext context)
        {
            IDataSource result = null;

            switch (context)
            {
            case CategoryChangeBulkActionContext categoryChangeContext:
                result = new BaseDataSource(_listEntrySearchService, categoryChangeContext.DataQuery);
                break;

            case PropertiesUpdateBulkActionContext propertiesUpdateContext:
                result = new ProductDataSource(_listEntrySearchService, propertiesUpdateContext.DataQuery);
                break;
            }

            var message = $"Unsupported bulk action query type: {context.GetType().Name}";

            return(result ?? throw new ArgumentException(message));
        }