OOP

Author: The Kacho | Posted on: 6/20/2010 5:41:19 PM | Views : 304

Hi,

I would like some advice on how to create C# classes to represent one to many relationships in C#.

I have a Customer and an Address table in my database. I also have a Customer class in my C# solution but how do I introduce the multiple address element? Do I have a separate Address class? Do I create a subclass in the Customer class or create a method in Customer called GetAddresses of type List which contains all of the relevant logic?

In my code I need to be able to return a customer with all associated addresses and I just cannot picture the best way to achieve this using OOP.

All help greatly appreciated.

Thanks
C
...

Go to the complete details ...