This article is about what is available in C# 6.0 with next version of compiler. You can have the binaries from roslyn.codeplex.com and use it. Here im going to demonstrate some key futures that useful in day to day programming .
1. Indexed Members and Element Initializers
There is several versions of it. Here is example for assign collection when it initialize in the code,
Ex : List<Ttype,Tvalue>
indexed Members with $ mark
indexing with Json data
Thanks and enjoy... Meet with next post with another feature
1. Indexed Members and Element Initializers
There is several versions of it. Here is example for assign collection when it initialize in the code,
Ex : List<Ttype,Tvalue>
Dictionary<string, string> sampleDemo =
new Dictionary<string, string>()
{
{"Mango", "Yellow"},
{"Banana", "Green"},
{"Pineapple", "Orange"},
{"Apple", "Red"}
};
//You can access each element like here
var c = sampleDemo ["Mango"];
indexed Members with $ mark
Dictionary<string, string> sampleDemo =
new Dictionary<string, string>()
{
$Mango="Yellow",
$Banana="Green",
$Pineapple="Orange",
$Apple="Red"
};
//You can access each element like here
var c = sampleDemo.$Mango;
indexing with Json data
Code:
Thanks and enjoy... Meet with next post with another feature