Tuesday, 7 November 2017

Dictionary Initializer in C# 6.0

In this article, We will discuss How to Use Dictionary Initializer in C# 6.0.

Dictionary Initializer is a new concept in C# 6.0 where Microsoft removed the Object {key,value} pair and directly we can assign values by the “=” operator.

For Example:

  Dictionary<stringstring> dicStr = new Dictionary<stringstring>()
            {
                ["Max"]="Texas"

            };

0 comments:

Post a Comment