Visual Studio 2010 New Feature-Generate From usage.

Visual Studio 2010 is Great IDE and I am exploring everyday a new things. Recently I was working with it and I have found a great features called Generate from usage. This feature is allow us to create a class from the generation from usage. Let’s take a sample example for that. Let’s Create a simple example where we will use a product class which is not there in project. Then from generate from usage feature we will create a product class. Here is code where product class does not exist in my console application project.

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Product objProduct = new Product();
}
}
}
Now lets create a new class from this new feature like following. Goto Product class line right click and then click generate->Class as shown in image below.GenerateClass

That’s is it will create a new class there in your solution like this.

ProductClass

So with this feature you will create as per you usage in class. Hope this will help you.Happy programming..

Shout it
kick it on DotNetKicks.com

Comments

Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Creating PDF with ASP.Net MVC and RazorPDF

Solution: gulp is not recognized as internal or external command- Visual Studio