I'm trying out the new scaffolding features in MVC 3, using Entity Framework Code First. My model looks like this:
public abstract class A
{
public int Id { get; set; }
}
public class B : A
{
public string Name { get; set; }
}
public class MyContext : DbContext
{
public DbSet<A> As { get; set; }
}
I create a new controller using the new controller wizard in MVC and select to scaffold type A. CRUD code is generated and I can successfully start the project in a webbrowser. When I try to create a new A, I get the following error message:
"Cannot create an abstract class"
which makes sense. A is abstract.
Can I use scaffolding to create B's and other inherited classes from A?