Why Nop.Web Model is null?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 Jahre weitere
[IMG]https://cdn1.imggmi.com/uploads/2019/3/14/67ce245078bb9da1e5da9f0db01948cb-full.png[/IMG]
In my picture u will see AllCategoryController which is my Plugins Controller and CategoryModel is from Nop.Web,but there is a problem and Problem is that model is null.Can u explain me why it is null?
This is CategoryModel
[IMG]https://cdn1.imggmi.com/uploads/2019/3/14/286f7f93d96f662a67eb4e07e5ffd31d-full.png[/IMG]
5 Jahre weitere
Hi,

the model is null because you are just creating an instance of it ( without populating any data to it ). You need to either use the CatalogModelFactory to populate the data of the category model or you can do it manually e.g. model.Name = category.Name;

Regards,
Hristian
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.