C# 6 Features

Post on 05-Jul-2015

156 views 1 download

description

C# 6 Features

transcript

Language Features

https://roslyn.codeplex.com/wikipage?title=Language%20feature%20status&referringTitle=Home

Property Initializers

• no explicit constructor code is required

• initialized auto-property only requires a getter, the set method is optional. With no setter, immutability is easier to achieve

• Plays well with primary constructor

Primary Constructors

Static type using statements

• Some usages we may use

– Check

– Assert

Expression Bodied Functions and Properties

Null propagation

Declaration Expressions

Declaration Expressions cont.

Nameof operator

Dictionary Initializer

Exception filters

await in catch and finally block

Discussion

• https://roslyn.codeplex.com/discussions/570551

Links

• http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated

• http://thebillwagner.com/blog/overview-of-c-6-language-enhancements

• http://msdn.microsoft.com/en-us/magazine/dn802602.aspx

• https://roslyn.codeplex.com/wikipage?title=Language%20feature%20status&referringTitle=Home

• http://www.dotnetcurry.com/showarticle.aspx?ID=1042

• http://www.pluralsight.com/courses/csharp-6-whats-new