4

I have used "code first from db" to create an entity class and include it as the type for a DbSet in a DbContext.

But I now have a new problem. I need to build an entity class at runtime that represents a row from an Oracle table/view and then use this class in the same manner as the compile time class (I can use Oracle GetSchema to provide the information to dynamically create the class type). I want to use it as the type behind a DbSet and include this DbSet in a DbContext.

Can this be done?

Can this DbSet be added to an existing/initialized DbContext? Or do I have to create a new DbContext, somehow add this DbSet to the DbContext and then initialize the DbContext?

I considered using non-generic DbSet but I read that this is being dropped from EF 7.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
DLipkie
  • 111
  • 5
  • This might be a good read for you [CodeProject: Unknown Class Dynamically Generated at runtime](http://www.codeproject.com/Articles/839640/Unknown-Class-Dynamically-Generated-at-runtime-for) – Jared Stroebele May 31 '16 at 19:22

0 Answers0