![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Question on design involving some Generics Hi, It's been a while. I am a bit stuck on deciding on how this should be done. I need to retrieve orders and their order items and pass the result back as a collection. I am aware on how to apply this to a point, but looking at my code I am making quite a bit of calls befire getting my results. Is there any way around this Public Function GetOrders(parameters) as Generic.List(Of Order) Dim _orders as New Generic.List(Of Order) ....getting data part orderdr = dal.GetOrders(parameter) While orderdr.read order = new order(orderdr(id),orderdr(name),date,otherparameters) --------Here is my issue. I have to call, for every order, the get items,so if my orderdr has 1000 items, I have to then make 1000 calls to get the items. order.items = dal.GetOrderItems(order.id) _orders.Add(order) End While return _orders Is there some other way around this and a common way it's usually done? Thanks |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| OO design question | .NET General | |||
| Re: Generics and comparison (follow on from my previous "Generics and collections" thread) | .NET General | |||
| Re: Generics and comparison (follow on from my previous "Generics and collections" thread) | .NET General | |||
| RTF Question: Is this a bug or by design? | Vista General | |||