New features of C# 3.0
Introduction
C# 3.0 includes following some great new features. This article is same as my original c# 3.0 new features post.
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.
Conclusion
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
Post Comment
jnnCpi Really enjoyed this blog.Really thank you! Awesome.