The 5th annual nopCommerce conference will take place in India on the 10th-11th of October. Please find more about this event here

Why Nop.Web Model is null?

Posted: March 14, 2019 at 2:33 PM Quote #225073

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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 15, 2019 at 2:45 AM Quote #225083
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 post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.Nop-Templates.com - the best place for nopCommerce themes and plugins

Follow us on
Facebook: http://www.facebook.com/NopTemplates
Twitter: http://twitter.com/NopTemplates
Blog: http://www.nop-templates.com/blog

www.Nop-Templates.com
nopCommerce Solution Partners
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2019
Learn more