aggregation simple .net code

  • Thread starter Thread starter Dave Johnson
  • Start date Start date
D

Dave Johnson

greetings,



can any one show sample example of aggregation in any .net code vb.net
or C#



i guess it shouldnt be that hard but i searched a lot without finding
anything that explains the issue in code. please help!

Sharing makes All the Difference
 
Dave,

At least you will have to tell how you want to aggregate.

In it simplest form it is only looping through a collection of data and add
the fields that has to be aggregated.

Cor
 
Greetings Cor,

i have 2 classes first one is an Order Class and the 2nd one is an
Booking Class. the order Object consists of one or more booking objects

would u try to show aggregation on this example or in any other example.
i just wanna see some code to get the idea right noneed even to comment
it :)

thnx

Sharing makes All the Difference
 
Dave,

Assuming that your Order has a collection of bookings, where in is a value

\\\
dim totalvalue as integer = 0
dim totalpersons as integer = 0
For each bk as booking in MyOrder.BookingCollection
totalvalue = bk.WhateverValue
totalamount = bk.TotalPersons
next
///

I hope this helps,

Cor
 
thanks cor for your help, but just to make sure i wanna say it this way.

my making a collection of objects from one class into the another class,
i am making an aggregation relationship between the two classes


is this 100% right or am i missing somthing.

thanks again

Sharing makes All the Difference
 
Back
Top