c#6.0 VS2015

Source: Internet
Author: User

https://msdn.microsoft.com/en-us/library/hh156499 (v=vs.140). aspx

This page lists key feature names for each version of C # with descriptions of the new and enhanced features in the lastest Version of the language.

Previous Versions

C # 1, Visual Studio. NET 2002

First release

C # 1.1, Visual Studio. NET 2003

#line pragma and XML doc comments

C # 2, Visual Studio. NET 2005

Anonymous methods, generics, nullable types, Iterators/yield, static classes, Co/contra variance for delegates

C # 3, Visual Studio. NET 2008

Object and collection initializers, lambda expressions, extension methods, anonymous types, automatic properties, Language Integrated Query (LINQ), anonymous types, local var type inference, LINQ

C # 4, Visual Studio. NET 2010

Dynamic, named arguments, optional parameters, generic Co/contra variance

C # 5, Visual Studio. NET 2012

Async/ await, caller information attributes

Visual Studio. NET 2013

BUG fixes, performance improvements, and technology previews of. NET Compiler Platform ("Roslyn")

C # 6, Visual Studio. NET 2015

Current version, see below

Current Version

Nameof

You can get the unqualified string name of a type or member-in-a error message without hard coding a string. This allows your code to remain correct when refactoring. This feature was also useful for hooking up Model-view-controller MVC links and firing property changed events.

String interpolation

You can use the string interpolation expressions to construct strings. An interpolated string expression looks like a template string that contains expressions. C # Creates a string by replacing the expressions with the ToString represenations of the expressions ' results. An interpolated string was easier to understand with respect to arguments than Composite formatting.

Null-conditional Member Access and indexing

You can-test for null-a very light syntactic-before performing a member access (?.) or index (? []) Operatio N. These operators help you write less code to handle null checks, especially for descending into data structures. If the left operand or object reference is NULL, the operations returns NULL.

Index initializers

You can now initialize specific elements of a collection that supports indexing, such as initializing a dictionary.

Collection Initializer and Add Extension Methods

You can use initializers for collections now when the collection have an Add Extension method. Previously the Add method had to is an instance method.

Overload Resolution

The compiler have improved overload resolution that results in more code just working the the-the-the-would expect it to behave . One place where you might stop noticing a problem are when choosing between overloads taking nullable value types, or when Passing method groups (instead of Lambdas) to overloads the take delegates.

Exception Filters

You can use exception filers on catch clauses to determine whether a catch clause should handle the exception. Without this feature, you has to rethrow the exception, which clips the call stack reported in the Rethrown exception.

Await in Catch and Finally Blocks

You can use the await in catch and finally clauses.

Auto-property initializers

Can initialize auto-properties now similarly to how do you initialize fields.

Getter-only auto-properites

You can define read-only auto-properties now without have to define a property with complete property syntax. You can initialize the property where you are declare it or in the type ' s constructor.

Function members with Expression bodies

You can declare members with expression-bodies of code in the same lightweight syntax your use with lambda expressions. See Methods (C # Programming Guide), Properties (C # Programming Guide), Indexers (C # Programming Guide), and overloadable O Perators (C # Programming Guide).

Using Static

You can IM

c#6.0 VS2015

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.