Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

how to keep relations ships between clases,

how many types of relation ship ,

how to create one to one and one to many.

[no name] 5-Aug-12 6:34am    
Just Three Sentence to explain what is in your mind?!!
Nobody can got your point.
Kenneth Haugland 5-Aug-12 7:07am    
Is this realted to SQL server, or is this programming in general. As it is now, this is not a question,
jameschowdaree 5-Aug-12 10:21am    
i was clearly given about c# classes,
Zoltán Zörgő 5-Aug-12 8:26am    
Looks like you need something like Entity Framework code first. Start here:, than here:
jameschowdaree 5-Aug-12 9:07am    

In OO there are many important types of relationships to name a few
- aggregation : a class refers to another one, but the class has no ownership of the referred class
- composition : a class refers to anothr one, and has ownership of the referred class
- inheritance : this is a "is a" relationship.

Another aspect is the cardinality. If a class contains for instance an array of another class the cardinality is * or max dimention of the array.

But this is all pretty basic stuff. If you don't know all this you should really read a good book about OO programming in general. Perhaps even UML because UML is all about relationships between classes both statically and dynamically.
Share this answer
jameschowdaree 16-Aug-12 22:19pm    
here i got ,Thanks Phillip
This is really a basic question that you could finmd the answer to by looking in Microsoft's Visual Studio manual:[^]

So I guess its back to basics :)
Share this answer
jameschowdaree 5-Aug-12 10:23am    
the links is about basic of c#, im not looking for this, im asking for the c# classes and its relationship.
thanks for reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900