Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# object to dictionary

public static Dictionary<string, TValue> ToDictionary<TValue>(object obj)
{       
    var json = JsonConvert.SerializeObject(obj);
    var dictionary = JsonConvert.DeserializeObject<Dictionary<string, TValue>>(json);   
    return dictionary;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: memset alternative in c# 
Csharp :: custom array initializer in c# 
Csharp :: write text files with C# 
Csharp :: c# shuffle list 
Csharp :: c# tostring currency 
Csharp :: c# find duplicates in list of strings 
Csharp :: c# datagridview column size 
Csharp :: c# get the last item in a list 
Csharp :: Find an item in a list by LINQ 
Csharp :: c# get value from textbox 
Csharp :: base64 decode how used in c# 
Csharp :: c# linq select from object list 
Csharp :: unity keycode for f 
Csharp :: unity 2d movement 
Csharp :: c# check if 2d array position exists 
Csharp :: smtp check if email sent 
Csharp :: c# return switch 
Csharp :: c# make request to rest api 
Csharp :: what is public static void 
Csharp :: how to write int array to console c# 
Csharp :: mvc get base url 
Csharp :: c# how to sort a list 
Csharp :: Play Sound c# 
Csharp :: .net mvc decimal displayformat currency 
Csharp :: ienumerable count 
Csharp :: c# date format 
Csharp :: unity new vector3 
Csharp :: wpf mouse over style trigger 
Csharp :: debug.log 
Csharp :: split string on last element 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =