Question: I'm creating a new MVC 3 application.  

Steps taken:  

1. Added new model by right clicking on Models and adding "LINQ to SQL Classes"  

2. Dragged tables from Server Explorer to my new dbml layout and saved  

3. Right click on Controllers->Add->Controller  

4. Enter the following information:  

> 
> **Controller name:** UserController  
> 
> **Template:** Controller with read/write actions and views, using Entity Framework  
> 
> **Model Class:** aspnet\_User (TierPay)  
> 
> **Data Context Class:** AgricultureDataContext (TierPay)  
> 
> **Views:** Razor (VBHTML)  
> 
> 
> 
> 

5.Click Add  

6.Get the following error:  

**Unsupported context type.**

I've Googled around and haven't found any answers.
Thanks!

Answer: 
I got this error message when I had mixed the "model class" and "data context class".
I got the same issue with EF. I am using the VS 2012
The reason for my case was.. this auto generation process (Scaffolding) seems not recognize the partial class concept.

I used the model first approach and I have used inheritance with the entities.
Ex: entity “B” and “C” is inherited from “A”

So in my generated model class “DataModelContainer” which is inherited from “DbContext”,
There is no definition for “DbSet” and “DbSet”
i.e: the following two lines were not there 

```
public DbSet<B> B { get; set; }
public DbSet<C> C { get; set; }

```

Generated “DataModelContainer” class I a partial class, so I completed the other part, using the concept of partial class. And this would be a problem for Scaffolding.

My workaround was, just removed the partial class I added manually. And added the definitions for “DbSet” and “DbSet” in to the auto generated class.
The problem with this solution is, I have to repeat the same thing when I regenerate the model classes.