Visual Studio 2010 New Feature-Generate From usage

No.of Views500
Bookmarked0 times
Downloads 
Votes0
By  jalpesh   On  08 May 2010 09:05:51
Tag : Visual Studios , Debug and BreakPoints
Visual Studio 2010 is Great IDE and I am exploring everyday a new things
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

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.

 

Image Loading

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

 

Image Loading

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

 
Sign Up to vote for this article
 
About Author
 
jalpesh
Occupation-Software Engineer
Company-DotNetJaps
Member Type-Expert
Location-India
Joined date-08 May 2010
Home Page-http://www.dotnetjalps.com
Blog Page-http://www.dotnetjalps.com
I am jalpesh vadgamaa an Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having experience of five year in Microsoft .NET Technology.I am working as Project Leader in Mid Size company.My work area comprises of Enterprise Level projects using ASP.NET and other Microsoft .NET Technologies.Please feel free to contact me for any queries via posting comments on my blog I will try to reply as early as possible.
 
 
Other popularSectionarticles
    Comments
    There is no comments for this articles.
    Leave a Reply
    Title:
    Display Name:
    Email:
    (not display in page for the security purphase)
    Website:
    Message:
    Please refresh your screen using Ctrl+F5
    If you can't read this number refresh your screen
    Please input the anti-spam code that you can read in the image.
    ^ Scroll to Top