nhibernate linq: projection to DTO and columns -


i've upgraded linq provider new ast one. (nh3 on nuget)

with previous provider using linq "inline projections dto" e.g.

from o in session.query<myobject>()  select new myobjectdto {  name = o.name,  subname = o.otherobject.name,  sub2name = o.otherobject2.name  }  

and generate

select o.name, sn1.name, sn2.name .....  join.... join.... 

statement.

once upgraded provider found lot of select statements being fired off. (my projected object more complex above). have come accross fetch/fetchmany, might number of queries, far can tell means full object come each flattened field require.

is there way can smallest possible number of columns required projection selected, rather loading full object graph project with?

thanks, chris

it must usage of result (like iterating many times iqueryable), odd mappings, or complexity removed example.

i tried exact query, , 1 sql statement generated.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -