Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

enter image description here

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!

like image 962
Gaurav Avatar asked Sep 21 '16 07:09

Gaurav


People also ask

How C language is created by?

C, computer programming language developed in the early 1970s by American computer scientist Dennis M. Ritchie at Bell Laboratories (formerly AT&T Bell Laboratories).

How do I start programming in C?

Get Started With C To start using C, you need two things: A text editor, like Notepad, to write C code. A compiler, like GCC, to translate the C code into a language that the computer will understand.

How do you create AC project?

From the menu bar, click File > New > Project. In the Select a wizard window, expand C/C++, select C++ Project, and then click Next. In the Create a C++ Project window, in the Project name field, enter a name for the C++ project. From the Project type list, select Makefile Project/Empty Project, and then click Finish.


1 Answers

Right click on .cs file having your classes and click on View Class Diagram: enter image description here

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

enter image description here

like image 159
Orkhan Alikhanov Avatar answered Sep 29 '22 17:09

Orkhan Alikhanov