Question

In NopCommerece MVC version, I am trying to move the mapping folder out of the DAL project to a seperate class library project, I am trying it to make the DAL more generic, so that it can be used in other projects as well.

But when I run the application, for every entity it says that "The entity type [EntityName] is not part of the model for the current context."

I think its happening because autofac is not finding IRepository for injection, any tips or ideas that where and what I am doing wrong?

Thanks in advance

Was it helpful?

Solution

OK! I found the solution to this issue, in the ObjectContext file, there is an overridden method named OnModelCreating, which was basically creating instances of mapping type objects in the assembly through reflection.

I have asked this method to look into a specific dll for those mapping entries and it started working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top