LLBL 4.2 - TypedView

Posts   
 
    
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 09-Jul-2014 06:01:03   

Hi Guys,

Using EF 6 on SQL Server 2012 I get this error:

An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code

Additional information: The entity type PersonGridTypedViewRow is not part of the model for the current context.

Based on

           return _db.Set<PersonGridTypedViewRow>()
                .Where(p => p.NationId == User.NationId && p.IsBahai && p.DOD == null && p.LocalId == localId)
                .OrderBy(p => p.LastName);

where _db is the MYDataContext(); that LLBL generates.

This typed view is based on a table (Right click Reverse engineer to Typed View) There is no _db.GetPersonGridTypedView().

Strangely, there is no reference to the PersonGridTypedViewRow anywhere in the edmx or the code generated by LLBL

How do I get the TYpedViews to be queryable?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Jul-2014 09:58:59   

Where does PersonGridTypedViewRow come from? As typed views based on table/view aren't supported by LLBLGen Pro for EF5/6 as EF 5/6 requires these types to have a PK and a typed view doesn't have a PK.

Did you map the PersonGridTypedViewRow class on a TVF as well?

Frans Bouma | Lead developer LLBLGen Pro
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 09-Jul-2014 16:59:51   

That explains it, it was based on a table. I'll use a type list instead, it S for a picker in a ui so I just need a few columns.

Typed list is probsbly more efficient too