Does anybody has any clue on these weir behaviors or discover
something similiar?

Thanks in advance.
Wolfium

On May 5, 11:32 am, Wolfium <[email protected]> wrote:
> I have found 2 weird behaviors while creating some test cases using
> rhino commons NH repository and Linq2Nh integration.
> The main concern or doubt, is neither of both make the test fail, I
> mean, the resulting enumeration is calculated properly, but it seems
> that behind the scenes, it is being resolved at memory using linq2Obj,
> I mean, it get the whole entity list from DB and then filter it to get
> the expected result.
>
> First, if you issue a linq statement usingUoW.CurrentSesion.Linq<City>() as 
> the in clause, it perform a SQL
> statement including all constraints defined in the linq statement, Up
> to this all is ok.
>
> Example: var filteredList = from c inUoW.CurrentSesion.Linq<City>()
> where c.Name == "value" select c;
> SQL issued: SELECT .... FROM cities WHERE name = 'value'
>
> On the other hand, when I tried to refactor the code creating a helper
> method on the class.
>
> var filteredList = from c in this.Cities where c.Name == "value"
> select c;
> Where Cities is: IEnumerable<City> Cities { get { 
> returnUoW.CurrentSesion.Linq<City>(); } }
>
> Now, the resulting list is still correct, but...
> SQL issued: SELECT .... FROM cities
>
> Second, I you try to add WHERE constraints dynamically by code, like
> result.Where(c => c.Name == "otherValue"), it is not honored in the
> SQL issued, while the result is again still correct.
>
> Any ideas or any help would be really appreciated.
>
> BTW, sorry for my english, I did my best. :)
>
> Thanks in advance.
> Regards
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Rhino Tools Dev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/rhino-tools-dev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to