2014/08/24

How to initialize Dictionary with default values in C# ?

public static Dictionary<int, string> GetProductsResponseErrors = new Dictionary<int,string>()
{
{ 0, "Operation success" },
{ 1, "Operation failed: invalid login or password." },
{ 2, "Operation failed: access denied." },
// ..
};
view raw gistfile1.cs hosted with ❤ by GitHub

No comments:

Post a Comment