I'm working on an older project at work. It is using LLBLGEN. It is referencing SD.LLBLGEN.Pro.DQE.SqlServer.NET20, SD.LLBLGEN.Pro.LinqSupportClasses.NET35, and SD.LLBLGEN.Pro.ORMSupportClasses.NET20,and SD.LLBLGEN.Pro.QuerySpec.
// Code is generated using LLBLGen Pro version: 3.5
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
My problem is, I noticed our web project was maxing out the servers memory. I ran the program in dotMemory, and found a call that was consuming 910 MB of memory.
There is an MVC view, with a model that has a property Customers which is a collection of CustomerEntity. In the view, it is calling Customer.Orders.Count , and it must be pulling back every single order for every customer that is display in that view (and then doing the count in memory), because that is causing the memory to sky rocket. Watching in the debugger, I see it is doing a select statement and not a count.
What is the proper way to get a count of elements in a navigator property in LLBLGEN?
Thanks!