TypedList number of related entities

Posts   
 
   
 
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 19-Oct-2006 23:46:02   

Hi guys,

I have two tables - 1 Album holds many Images. What I want is a a TypedList that has:

  • albumid
  • albumtitle
  • imagecount

i.e 2, "holiday photos", 20

Is it possible to define a TypedList in the designer that will provide this info or will i have to create a dynamic typed list?

Cheers,

Pete

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 20-Oct-2006 04:28:18   

It is very possible. Define the typedlist between Album and Images. Add the AlbumId and AlbumTitle columns from Album to the typedlist. Then add the pk of the Images table to the typedlist and use count as the aggregate function.

Now when you fetch the typedlist be sure to add the two fields from the Album entity to a groupbycollection to be passed in the fetch call.

Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 20-Oct-2006 11:01:12   

Hi brian,

thanks, that did the trick simple_smile

cheers, pete