Need help understanding the NopModel

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
I don't really understand how the NopModel.edmx communicates with the entity classes created in the NopSolutions.NopCommerce.BusinessLogic namespace i.e how these classes map to their respective tables in the database. I know the procedure of creating an entity data model that generates classes from the database objects or tables, but I don't know the magic behind the creation of the NopModel.

Please I really need a quick help to this problem of mine to understand the concept behind it. Very many thanks in advance to anyone or evryone that helps me out.
13 年 前
Kelly wrote:
I don't really understand how the NopModel.edmx communicates with the entity classes created in the NopSolutions.NopCommerce.BusinessLogic namespace i.e how these classes map to their respective tables in the database. I know the procedure of creating an entity data model that generates classes from the database objects or tables, but I don't know the magic behind the creation of the NopModel.

Please I really need a quick help to this problem of mine to understand the concept behind it. Very many thanks in advance to anyone or evryone that helps me out.


NopObjectContext.ObjectSets.tt is a text transformation file that generates (automagically)
NopObjectContext.ObjectSets.cs

That is what ends up mapping the things in the Model with your Implementations.
If you create a new namespace make sure it is included at the top of the .tt file (where the other using statements are)

Other than that you shouldn't need to do anything to the text template. As long as the class is in the model and in the BusinessLogic it will be mapped. If you having errors with the mapping capitalization matters.

I hope this helps.
13 年 前
Thanks Ozzied but i really want to get this straight. Are u saying I should add a new item to the project and either select ADO.NET Entity object Generator or the ADO.NET Self-Tracking Entity Generator to create the NopObjectContext class or something to map those implemented classes to the model? Please I need you to be more elaborate on this one.
Many thanks
13 年 前
I realize this is old but I'm stuck on the same issue. Is there anywhere that the this documentation exists?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.