Using GetMulti to return list of ONLY PK

Posts   
 
    
amccool avatar
amccool
User
Posts: 18
Joined: 08-Jun-2007
# Posted on: 07-Nov-2007 01:06:46   

I need to optimize a query to return only the PK's from a table.

GetMulti(null) against my table returns all the data in the table. I only need the PK column. I cant seem to find a way to do this via the documentation.

Am I going about this the wrong way?

Thanks, Alex

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Nov-2007 03:47:23   

You can project a PK resulset on a EntityCollection. http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=11776

David Elizondo | LLBLGen Support Team
amccool avatar
amccool
User
Posts: 18
Joined: 08-Jun-2007
# Posted on: 07-Nov-2007 17:32:23   

I am using v2.0. Is this feature available?

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 07-Nov-2007 23:59:31   

Yes that is in 2.0. Also, if you go to 2.5, you can have it only bring back certain fields in the getmulti call...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Nov-2007 11:16:36   

Projection is available since v. 2.0. And in v. 2.5 you may execlude fields from being fetched (a new feature). Which also enables you to fetch the excluded fields later on into the same collection.

Otherwise you may just use a DynamicList, wich IMHO is the best solution, especially if there is no need for the EntityCollection.

amccool avatar
amccool
User
Posts: 18
Joined: 08-Jun-2007
# Posted on: 08-Nov-2007 18:22:59   

oh right DynamicList, thats ringing some bells.

Thanks Guys!!! smile