Close

Error after change in IProductService

umut.gulkok
12 years ago
#1586 Quote
Avatar
  • 1
My site (v2.50) is a book store site. It and the ajax filters were funtioning well. However, I had to add a new table for book authors, this table's relationship with the products is exactly the sama as the manufacturers.

After some work some methods in the IProductService changed like the following
IPagedList<ProductVariant> SearchProductVariantsEx(int categoryId, int manufacturerId, string keywords, bool searchDescriptions, int pageIndex, int pageSize, bool showHidden = false, int writerId = 0);

This bold writerId parameter is added. But since it is optional it shouldn't be a problem.

I get the below exception when I click some specification in the ajax filter while the jquery post a command to "http://localhost:2640/Catalog7Spikes/GetFilteredProducts"

------------------------------------------------------------
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

[MissingMethodException: No parameterless constructor defined for this object.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +67
----------------------------------------------------

I gues this exception is very tipical when there is an inconstistency between nop services and sevenspikes core. But in order to correct the problem I should know all the dependencies between them. Which interfaces/services are critical for the sevenspikes core and ajax filter?
Boyko
12 years ago
#1588 Quote
Avatar
  • 1570
umut.gulkok wrote:
My site (v2.50) is a book store site. It and the ajax filters were funtioning well. However, I had to add a new table for book authors, this table's relationship with the products is exactly the sama as the manufacturers.

After some work some methods in the IProductService changed like the following
IPagedList<ProductVariant> SearchProductVariantsEx(int categoryId, int manufacturerId, string keywords, bool searchDescriptions, int pageIndex, int pageSize, bool showHidden = false, int writerId = 0);

This bold writerId parameter is added. But since it is optional it shouldn't be a problem.

I get the below exception when I click some specification in the ajax filter while the jquery post a command to "http://localhost:2640/Catalog7Spikes/GetFilteredProducts"

------------------------------------------------------------
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

[MissingMethodException: No parameterless constructor defined for this object.]

I gues this exception is very tipical when there is an inconstistency between nop services and sevenspikes core. But in order to correct the problem I should know all the dependencies between them. Which interfaces/services are critical for the sevenspikes core and ajax filter?


Hi umut.gulkok,

Unfortunately adding optional parameters is a breaking change.
Where exactly do you need(use) the new parameter writerId and how you intend to use it (on which pages)?
The Filters depend on most of the services available in nopCommerce as it need to work with the Categories, Manufacturers, Specification and Attributes - ICategoryService, IManufacturerService, IProductService etc. Basically the controllers of the Filters use the same interfaces as the CatalogController.

Best Regards,
Nop-Templates Support Team
Regards,
Nop-Templates.com Team