Out variables |
Before
The only way to initialize an Auto Property is to implement an explicit constructor and set property values inside it.
|
Tuples and deconstruction |
In C# 6, primary constructor gives us a shortcut syntax for defining constructor with parameters. Only one primary constructor per class is allowed. |
Pattern matching |
dictionary initializer like an array using square brackets. |
public class DictionaryInitializerInCSharp6
{
public Dictionary _users { get; } = new Dictionary()
{
["users"] = "Venkat Baggu Blog",
["Features"] = "Whats new in C# 6"
};
}
|
Local functions |
await keyword is not available inside the catch and finally blocks. In C# 6, we can finally use the await keyword inside catch and finally blocks.
|
Expanded expression bodied members |
|
Ref locals and returns |
|
Expanded expression bodied members
Comments
Post a Comment