Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

inline creation dictionnary C#

var dict = new Dictionary<string, int>
{
	{ "one", 1 },
	{ "two", 2 },
    { "three", 3 }
};
Comment

inline creation dictionnary C#

#With C#6
var dict = new Dictionary<string, int>
{
    ["one"] = 1,
    ["two"] = 2,
    ["three"] = 3
};
Comment

PREVIOUS NEXT
Code Example
Csharp :: wpf make size fill all grid 
Csharp :: how to reference a UI element in unity 
Csharp :: add all elements in a list c# 
Csharp :: can you have multiple statement in a case c# 
Csharp :: editorfor date format mvc 
Csharp :: linq where 
Csharp :: c# access session in class 
Csharp :: c# Get type with namespace 
Csharp :: c# change label from thread 
Csharp :: add variable to the beginning of a list c# 
Csharp :: c# sort array of objects 
Csharp :: No migrations configuration type was found in the assembly 
Csharp :: C# function return datareader 
Csharp :: html.beginform 
Csharp :: c# razor add disabled to button if 
Csharp :: calculate distance using latitude and longitude c# 
Csharp :: unity print vs debug log 
Csharp :: Replaced OS is obselete 
Csharp :: how to run a c# program 
Csharp :: convert string to jtoken c# 
Csharp :: unity get game version 
Csharp :: c# isdigit mehod 
Csharp :: c# .net core memory cache 
Csharp :: C# datareadeer return null 
Csharp :: unity create 3d object in script 
Csharp :: c# convert dictionary object to string 
Csharp :: c# right function 
Csharp :: c# convert long to int 
Csharp :: c# string slice 
Csharp :: c# html to pdf 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =