Created
January 25, 2017 20:28
-
-
Save deepumi/ac2a7fa70308406b854f0856e83703fd to your computer and use it in GitHub Desktop.
CSharp6.0 features
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExpressionBodied Methods => public string SomeMethod => "Hello world"; | |
ConditionalAccessOperator - Elvis Operator ?. SomeMethod?.Property | |
AutoPropertyIntializers public List<string> Roles {get;set;} = new[] {"FFF","FF"}; | |
Primary Constructor | |
class C(string a, string b) | |
{ | |
public string ItemA {get;set;} = a; | |
public string ItemB {get;set;} = b; | |
} | |
Out parameter declaration during method call | |
public bool CheckValue(string value){ | |
if(int.TryParse(value,out int newValue) && newValue > 10) | |
return true; | |
else | |
return false; | |
} | |
Await in the CATCH block; | |
Exception filters | |
using Static class (ex: using System.Console;) | |
WriteLine("Hello world"); | |
StringInterpolation $"{dynamicValue}"; | |
https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment