Powered by Blogger.

Saturday, March 8, 2014

Commenting in Visual Studio in C#.Net

In this blog we will discuss about different ways to comment lines of code.

Also you can check out:

- Asp.Net MVC4 sample application

- Transforms in WPF and their types

- How to create Thread Pool via TPL in C#.Net?

C#.Net provides 3 types of commenting in visual studio.

1- Single line commenting:
C#.Net provides // symbol to comment single line of code.
Example: // int a = 0;

2- Multiline commenting:
C#.Net provides /* and */ for multiple commenting.
/* int a = 0;

int b = 1;

int result = a + b;  */

3- XML style commenting:
XML comments always start with three slashes.
This type of commening usually used to describe the code like it can be used in describeing the class or methods.

/// <summary>
/// This class used for registration
/// By AspDotNetHelp members
/// </summary>