This project has moved. For the latest updates, please go here.

Make "request to server-side" twice when using Execute method in NTier.Client.Domain.QueryProvider

May 30, 2014 at 9:24 PM
When I implemented DynamicLinq to N-Tier, I recognized that System made "request to server-side" twice when executing FirstOrDefault or SingleOrDefault.

After searching around the code-base of N-Tier Entity framework, I saw a bad code at line 256 of QueryProvider.cs in NTier.Client.Domain project: _queriable.FirstOrDefault().

If you run debug here, you will see that the "ParseExpression(expression)" make a call to server-side and put result to "_queriable". The code at line 256 want to return an object, it is a correct idea. But "_queriable.FirstOrDefault()" will make other call to server-side, it is incorrect. I changed it to "_queriable.AsEnumerable().FirstOrDefault()" and it works correctly.

Hope Trivadis team take a look in this issues before publishing next verions.
Jun 5, 2014 at 12:08 AM
Thank you very much for raising this issue.
We've applied the fix and pushed the change: