Visual Studio Class Diagram not showing relationships

C#.NetVisual Studio

C# Problem Overview


When I define my class properties with out using fields (which was enabled with C# 3.0), class diagram is not showing my one to one/many relationships. Inheritance is visible in the diagram though..

Is there a way to fix this?

C# Solutions


Solution 1 - C#

When you right click on the field or property you can select show as association or show as collection association.

Solution 2 - C#

It's for people like me who do not find where is the menu item in 1 minute.enter image description here

Solution 3 - C#

In Visual Studio 2013: right click the class, click Add, and select the desired relationship.

enter image description here

More information: http://msdn.microsoft.com/en-us/library/ff657806.aspx

Solution 4 - C#

This combines with Visual Studio and does everything you want to do with Class diagrams. http://modeling.codeplex.com/

Solution 5 - C#

Since someone asked how to download files from old codeplex.com, I will briefly explain the steps below.

  1. Access the link. In this case it is http://modeling.codeplex.com/.
  2. Click "download archive" button to download the archive.
  3. Open the downloaded zip file. ex) modeling.zip File structure in the archive file
  4. Navigate to "releases" folder if you are after the binary not the source.
  5. Open the releaseList.json file to see the description and the actual name of each file. Detailed info for each file
  6. Find the one you want and get the folder Id, file Id and FileName from the releaseList.json.
  7. Navigate to the folder matching the folder Id. ex) 2
  8. Select the file matching the file Id and copy to some other place. Rename the file with FileName from the releaseList.json.
  9. You can go from there.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkaivalyaView Question on Stackoverflow
Solution 1 - C#REA_ANDREWView Answer on Stackoverflow
Solution 2 - C#rockXrockView Answer on Stackoverflow
Solution 3 - C#Maria Ines ParnisariView Answer on Stackoverflow
Solution 4 - C#CharithJView Answer on Stackoverflow
Solution 5 - C#CailleuView Answer on Stackoverflow