How do I make a data context class out of an entity data model (edmx)?

c# entity-framework

Question

This is my first time to use Entity Data Model as data access layer.

From some example codes, I see people have data context class that inherit from DbContext

[file name: FooEntities.Context.tt]
public partial class FooEntities : DbContext
{
    // ...
}

when I try to Add Code Generation Item from entity data model (edmx) , I always have data context class that inherit from ObjectContext

[file name: FooEntities.Context.tt]
public partial class FooEntities : ObjectContext
{
    // ...
}

So, how do we generate data context files that inherits from DbContext?

0
0
8/25/2011 10:37:46 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow