views:

24

answers:

1

i have the following code using Nhibernate.Linq

   var apps = Session.Linq<History>().OrderByDescending(r => r.LastUpdated).Take(50);
   Console.Write(apps.Count());

the count returns 1000 (NOT 50 which is what i would have expected)

any ideas why the .Take() is not working?

+1  A: 

It looks like a bug in the Linq provider (you are using the old one, I tried the new one too and it still doesn't work).

You should open an issue in http://jira.nhforge.org/

As a workaround, use .ToList() in the assignment to apps.

Diego Mijelshon
@Diego - http://216.121.112.228/browse/NH-2271
ooo
You should either attach the classes and mappings, or use some of the existing ones in the test project, and create a proper unit test that fails. Look at the examples in the source code.
Diego Mijelshon