Yep, that is correct.
I worked out a solution with an ActionFilter and it works fine.
Thank you very much!
Oh, and about the error. It is a strange thing isn't it? I'm trying to build against the 3.5.2 nuget assemblies, but that should be the same thing right?
I can reference pretty much anything in the 7Spikes assembly, ecxept for all things mvc related (i.e. Controllers and the like). Maybe it has something to do with the obfuscation that is applied to the assembly?
Ah yes of course, Action filters, why didn't I think of that? I'm going to try it out right away.
Thanks for the tip!
We created a custom CatalogController which returns a specific custom model. This works fine, until we try to use Nop Ajax Filters, because an incorrect model is returned by getFilteredProducts. So I thought, I'll just create a wrapper for Catalog7SpikesController, change the route in the view and be done with it.
I had in mind something like this:
public partial class StrelliCatalog7SpikesController : BasePublicController {
private readonly Catalog7SpikesController _catalog7SpikesController;
public StrelliCatalog7SpikesController(
ICategoryService categoryService,
//... omitted for brevity ...//
ICacheManager cacheManager,
IProductServiceNopAjaxFilters productServiceNopAjaxFilters,
IPriceCalculationServiceNopAjaxFilters priceCalculationServiceNopAjaxFilters,
IFiltersPageHelper filtersPageHelper,
NopAjaxFiltersSettings nopAjaxFiltersSettings,
IQueryStringBuilder queryStringBuilder,
IQueryStringToModelUpdater queryStringToModelUpdater,
ICategoryService7Spikes categoryService7Spikes
) {
_catalog7SpikesController = new Catalog7SpikesController(
categoryService, //... omitted for brevity ...//
cacheManager, productServiceNopAjaxFilters, priceCalculationServiceNopAjaxFilters,
filtersPageHelper, nopAjaxFiltersSettings, queryStringBuilder, queryStringToModelUpdater,
categoryService7Spikes
);
}
public ActionResult GetFilteredProducts(
int categoryId, int manufacturerId, int vendorId,
PriceRangeFilterModel7Spikes priceRangeFilterModel7Spikes,
SpecificationFilterModel7Spikes specificationFiltersModel7Spikes,
AttributeFilterModel7Spikes attributeFiltersModel7Spikes,
ManufacturerFilterModel7Spikes manufacturerFiltersModel7Spikes,
VendorFilterModel7Spikes vendorFiltersModel7Spikes, CatalogPagingFilteringModel pagingFilteringModel,
OnSaleFilterModel7Spikes onSaleFilterModel, string queryString, bool shouldNotStartFromFirstPage,
string keyword, int searchCategoryId, int searchManufacturerId, decimal? priceFrom, decimal? priceTo,
bool includeSubcategories, bool searchInProductDescriptions, bool advancedSearch, bool isOnSearchPage
) {
var result = _catalog7SpikesController.GetFilteredProducts(
categoryId, manufacturerId, vendorId, priceRangeFilterModel7Spikes,
specificationFiltersModel7Spikes, attributeFiltersModel7Spikes,
manufacturerFiltersModel7Spikes, vendorFiltersModel7Spikes,
pagingFilteringModel, onSaleFilterModel, queryString,
shouldNotStartFromFirstPage, keyword, searchCategoryId,
searchManufacturerId, priceFrom, priceTo, includeSubcategories,
searchInProductDescriptions, advancedSearch, isOnSearchPage
);
// Add our own stuff to the results and return them
}
}
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.2.3.0"/>
</dependentAssembly>