GetScalar with AggregateFunction.Min on 1 field

Posts   
 
    
Puser
User
Posts: 228
Joined: 20-Sep-2012
# Posted on: 02-Aug-2013 10:48:39   

Hello,

I'm trying to get a minimum value from a table with a filter. But I can't seem to get a valid IExpression on one field. So this following code is working for me now, but is not really optimized:

int eersteDruknrVanUitgave = (int)EntityManager.DataEntityManager.GetScalar(DrukFields.Druknr,
                    DrukFields.Druknr + DrukFields.Druknr - DrukFields.Druknr,
                    AggregateFunction.Min,
                    (DrukFields.UitgaveId == druk.UitgaveId));

Please let me know if there is a better way.

thank you

Using LLBLGen Pro v3.5 Final January 17th, 2013

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 02-Aug-2013 18:04:29   

Why do you think this is not optimized?