Answers for "convert json list to dictionary in c#"

C#
1

dictionary to list c#

Dictionary<string, string> dicNumber = new Dictionary<string, string>();
List<string> listNumber = new List<string>();

dicNumber.Add("1", "First");
dicNumber.Add("2", "Second");
dicNumber.Add("3", "Third");

listNumber = dicNumber.Select(kvp => kvp.Key).ToList();
// Or:
listNumber = dicNumber.Keys.ToList();
Posted by: Guest on August-17-2021
0

c# dictionary to json

return JsonConvert.SerializeObject( myDictionary );
Posted by: Guest on September-01-2021

Code answers related to "convert json list to dictionary in c#"

C# Answers by Framework

Browse Popular Code Answers by Language