Ideally the user should be able to provide SQL to override any LINQ expression they wish to override. This has proved too tricky to get working at the moment, so there's a special case for Count(). Unfortunately, it doesn't detect the case where Count() is applied to a filtered result set (e.g. by Take()), so it will return the wrong value in this case.
Ideally the user should be able to provide SQL to override any LINQ expression they wish to override. This has proved too tricky to get working at the moment, so there's a special case for Count(). Unfortunately, it doesn't detect the case where Count() is applied to a filtered result set (e.g. by Take()), so it will return the wrong value in this case.