简体   繁体   中英

How to create a C# class diagram in visual studio 2015/

I need to create a class diagram from my existing code. Suppose I have the following classes -

public class Person
{
   public string Name { get; set;} 
   public int Age { get; set;} 

   public Address Address { get; set; }
   public Education Education { get; set; }
}

public class Address
{
   public string AddressLine1 { get; set; }
   ....
}

public class Education
{
   public string CollegeName { get; set; }
   ....
}

I want to create a digram for Person class like:

在此输入图像描述

I know about the UML diagram but it dosen't create what I am expecting. As far as I know it only creates the inheritence hierarchy.

I am using Visual Studio 2015 community edition. Can anyone tell me the tool to create the class digram as I mentioned above?

Thanks!

Right click on .cs file having your classes and click on View Class Diagram: 在此输入图像描述

After that go to the class property you want and right click then choose Show As Association

在此输入图像描述

yUML is a Visual Studio extension which should layout your classes in the way you want.

It will automatically render your class and property associations using 'dependency links' without having to do it manually (using Class Diagram), but of course, it's an extension you'll need to download.

yUML截图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM