Scaffolding with Entity Data Model and Inheritance

Dec 9, 2011 at 11:18 PM

I have a project an Entity Data Model generated from the database. I deleted a table relationship and added an inheritance link instead.

When I try to create a Users controller using scaffolding everything is generated (Controller + Views) but the repository generation fails.

I am using 2 tables

aspnet_Users (ApplicationId, UserId, ...)
UserDetails (UserId, ...)

I am trying to generate the scaffolding fro UserDetails (which inherits aspnet_Users)

Here is the error log.

Scaffolding UsersController...
Invoke-Scaffolder : Web.Models.MyProjectEntities is not a System.Data.Entity.DbContext class and does not contain a 'UserDetails' property, so it cannot be used as the database context.
At G:\Development\MyProject\packages\T4Scaffolding.1.0.5\tools\EFRepository\
1:35 char:39
+     $dbContextScaffolderResult = Scaffold <<<<  DbContext -ModelType $ModelType -DbContextType $DbContextType -Area $Area -Project $Project -CodeLanguage $CodeLanguage -BlockUi
    + CategoryInfo          : NotSpecified: (:) [Invoke-Scaffolder], RuntimeException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.InvokeScaffolderCmdlet 

Added controller Controllers\UsersController.cs
Added Create view at 'Views\Users\Create.cshtml'
Added Edit view at 'Views\Users\Edit.cshtml'
Added Delete view at 'Views\Users\Delete.cshtml'
Added Details view at 'Views\Users\Details.cshtml'
Added Index view at 'Views\Users\Index.cshtml'
Added _CreateOrEdit view at 'Views\Users\_CreateOrEdit.cshtml'

What could be going wrong?