Click here to Skip to main content
14,304,886 members

New features of C# 3.0

Rate this:
2.17 (15 votes)
Please Sign up or sign in to vote.
2.17 (15 votes)
7 Jun 2011CPOL
New features available in the C# 3.0


C# 3.0 includes following some great new features.  This article is same as my original c# 3.0 new features post. Read more for c# 4.0 new features 

Implicitly typed variables (var)

C# 3.0 supports implicitly typed local variables by making use of a new keyword var. These variables are not typeless; rather, their type is inferred at compile time  


Auto properties

Auto-implemented properties are another helpful new feature to save us some typing and reduce the potential to introduce bugs.


Object initialization

C# 3.0 introduces two new features that help when instantiating and initializing object instances. Using object and collection initializers, you can instantiate and initialize either an object or a collection in one compound statement.


Partial Methods 

C# 2.0 introduced partial class definitions.C# 3.0 adds to that by introducing partial methods. Using partial methods, We can implement the methods in separate file (same partial class)



Extension Methods 

Extension methods are one of the most exciting new features.Extension methods enable you to add methods to existing types without creating a new derived type



LINQ (Language Integrated Query)

The granddaddy of all new C# 3.0 features has to be LINQ, which builds upon all of the new features, especially extension methods, lambda expressions, and anonymous types.You can use LINQ to access data from multiple sources. That means from native object collections, SQL data stores, and XML. 


Related article

Please go through my post on c# 4.0 new features for more information :-)


  • Added C# 4.0 new features reference added   - 06-June-2011
  • Posted - 04-June-2011


This tutorial was created to help you understand the new features of C# 3.0. I Hope u have found this tutorial helpful and interesting. fore more c# tutorials please visit my post here


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

A Mahesh
Web Developer
India India
Symphony Services, Banglore, 560 087, India

Comments and Discussions

GeneralMy vote of 1 Pin
shindepradip15-Mar-14 0:15
professionalshindepradip15-Mar-14 0:15 
General[My vote of 1] too little too late Pin
BillW338-Jun-11 9:08
professionalBillW338-Jun-11 9:08 
GeneralMy vote of 1 Pin
fjdiewornncalwe8-Jun-11 7:50
professionalfjdiewornncalwe8-Jun-11 7:50 
GeneralMy vote of 1 Pin
darthrevenant7-Jun-11 20:26
memberdarthrevenant7-Jun-11 20:26 
GeneralWhy I did not vote. Pin
Keith Barrow7-Jun-11 9:13
mentorKeith Barrow7-Jun-11 9:13 
GeneralMy vote of 1 Pin
Selvin7-Jun-11 3:37
memberSelvin7-Jun-11 3:37 
GeneralWhy .NET 2 Pin
Pete O'Hanlon7-Jun-11 2:42
protectorPete O'Hanlon7-Jun-11 2:42 
GeneralMy vote of 1 Pin
Nagy Vilmos6-Jun-11 1:43
professionalNagy Vilmos6-Jun-11 1:43 
GeneralRe: My vote of 1 Pin
A Mahesh6-Jun-11 16:39
memberA Mahesh6-Jun-11 16:39 
GeneralMy vote of 2 Pin
Adrian Pasik5-Jun-11 23:30
memberAdrian Pasik5-Jun-11 23:30 
GeneralRe: My vote of 2 Pin
A Mahesh6-Jun-11 16:35
memberA Mahesh6-Jun-11 16:35 
GeneralWAY too late with this one Pin
Dave Kreskowiak5-Jun-11 4:37
mveDave Kreskowiak5-Jun-11 4:37 
GeneralRe: WAY too late with this one Pin
A Mahesh6-Jun-11 16:36
memberA Mahesh6-Jun-11 16:36 
GeneralRe: WAY too late with this one Pin
Dave Kreskowiak6-Jun-11 16:51
mveDave Kreskowiak6-Jun-11 16:51 
GeneralIn which generation are you living? Pin
Kunal Chowdhury «IN»5-Jun-11 4:16
mentorKunal Chowdhury «IN»5-Jun-11 4:16 
GeneralRe: In which generation are you living? Pin
Member 18388315-Jun-11 11:14
memberMember 18388315-Jun-11 11:14 
GeneralRe: In which generation are you living? Pin
jim lahey6-Jun-11 0:38
memberjim lahey6-Jun-11 0:38 
GeneralRe: In which generation are you living? Pin
Pete O'Hanlon7-Jun-11 2:38
protectorPete O'Hanlon7-Jun-11 2:38 
GeneralRe: In which generation are you living? Pin
A Mahesh6-Jun-11 16:37
memberA Mahesh6-Jun-11 16:37 
General[My vote of 2] Really interesting idea... Pin
Kubajzz4-Jun-11 21:14
memberKubajzz4-Jun-11 21:14 
JokeRe: [My vote of 2] Really interesting idea... Pin
Kunal Chowdhury «IN»5-Jun-11 4:17
mentorKunal Chowdhury «IN»5-Jun-11 4:17 
GeneralRe: [My vote of 2] Really interesting idea... Pin
Member 18388315-Jun-11 11:11
memberMember 18388315-Jun-11 11:11 
GeneralRe: [My vote of 2] Really interesting idea... Pin
Kunal Chowdhury «IN»5-Jun-11 12:56
mentorKunal Chowdhury «IN»5-Jun-11 12:56 
GeneralLinq Example Pin
George Swan4-Jun-11 20:27
memberGeorge Swan4-Jun-11 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 4 Jun 2011


11 bookmarked