From: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 21:02:56
|
Linq LongCount() behavior different from Count() ------------------------------------------------ Key: NH-2691 URL: http://216.121.112.228/browse/NH-2691 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.1.0 Reporter: Kelly Stuard Priority: Minor It seems to me that Count() and LongCount() should behave the same, except for the max value they return. I am finding this not to be the case. Consider the following example: var query = from cat in session.Query<Cat>() orderby cat.Born select cat; var queryCount = query.Count(); // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ var queryLongCount = query.LongCount(); // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ order by cat0_.Born I am partial to the behavior of .Count() where it ignores the order. Also, it seems that LongCount() should probably cast as a long, instead of an int. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |