0

Anyone suggest me how to handle the following scenario. I have some Db tables that are using in all of my projects so I am creating all these tables in every database (common tables + project tables). Now I have a common data and business libraries that depend on the common tables, I need to split these table entities into two different libs with a single DbContex. I am using the dependency injection to pass the db context.

I am using the following Vs tools. EF 4.1 VS 2010.

Regards, Hareen.

hareen
  • 31
  • 1
  • 5

1 Answers1

0

You can either use inheritance like below or

public class CommonContext:DbContext
{
}

public class ProjectContext:CommonContext
{
}

Composition like this. (The answer I have given for your earlier question

Community
  • 1
  • 1
Eranga
  • 32,181
  • 5
  • 97
  • 96