How to use asp.net MVC Scaffolder with a context that is two subclasses down from dbcontext

I have a standard set of models.

I have a base context class that inherits from dbcontext to add some functions I need.

public class MyContext : DbContext
{
    public void MyFeature() {
    }
}

Then I have my actual data context:

public class DataContext : MyContext
{
    public DbSet<Category> Categories { get; set; }
    public DbSet<Product> Products { get; set; }
}

scaffolder , "Unsupported Context Type" datacontext, dbcontext, , , , , . , , , , datacontext , scaffolder , , datacontext - dbcontext.

scaffolder datacontext?

+3
2

?

, , , ContextDetails - - DataContext ContextDetails

//Changed MyContext to ContextDetails
public class ContextDetails 
{
    public void MyFeature() 
    {
        //Do something
    }
}

public class DataContext : DbContext
{
    public DbSet<Category> Categories { get; set; }
    public DbSet<Product> Products { get; set; }

    public ContextDetails DbDetails { get; set; }
}

ContextDetails DataContext/DbContext, DataContext/DbContext .

, , . http://www.codeproject.com/Tips/309753/Repository-Pattern-with-Entity-Framework-4-1-and-C

System.Data.EntityDbContext,

, , .

EDIT:

, DBDetails , . . !

+2

, entity framework 4.0, , , , .

0

All Articles