How do I create views of objects in Entity Framework 6? -


let's suppose following tables:

tablea

tableaid int, pk, non-null name     varchar(50), non-null 

tableb

tablebid int, pk, non-null name     varchar(50), non-null 

tableatotableb

tableatotablebid int, pk, non-null tableaid         int, fk, non-null tablebid         int, fk, non-null 

then let's wanted view bind display:

select a.tableaid,         a.name,        count(*) countoftableatotablebid   tablea      inner join         tableatotableb ab      on a.tableaid = ab.tableaid group a.tableaid, a.name 

what easiest way retrieve views in entity framework it's easy each row returned still tablea object? should return in 1 query database well.

basically want return tablea object additional columns display purposes, internally should still accessed tablea object. hope makes sense.

i'm struggling how entity framework attempts deal complex views of multiple objects in efficient , easy manage way.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -