Unable to extend NopCommerce models in plugins.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
In nopcommerce there are a lot of partial classes which seems to be there to be extended via plugins.but as mentioned in MS documents partial classes should be reside in same dll file.so the question is what is the intention behind making models partial?and what is the correct way of extending models in nopcommerce?
6 years ago
You are correct, you cannot add code to a partial class in a plugin. Presumably they are marked as partial so that developers can add their own code without modifying the original class files.

There is a ModelPrepared event in Nop 4 which gives you a chance to add data to the model before it is rendered. Additional data can be stored in CustomProperties.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.