3

I've been trying to scaffold out a DBContext class (Code first), which resides in a different assembly with the reference added to the current MVC project.

VS2012 is giving me a message that says that the DBContext is in a different assembly and that, it is not able to modify the class. I understand that it won't be able to modify the class as it is in a different assembly, but the class already has the required DBSets as fields.

The solution that comes to my mind is to create proxy DBContext in my MVC project, use it to scaffold it out and link it to the original DBcontext inside the controller.

Are there any correct/better/easier way around this? Am I missing something really obvious here?

Thank you.

edocetirwi
  • 542
  • 5
  • 22
  • Haven't got much experience with scaffolding but it may be a better option to have your POCOs in a separate library (without context) and have only one context in the library where it needs modification. – Gert Arnold Feb 11 '13 at 22:27
  • It is already separated out, the POCOs are in a different library and there is a another library which houses the DBContext and the items that directly talks to the DB (DAL). – edocetirwi Feb 11 '13 at 23:05

0 Answers0