using System.Collections.Generic;
public static void Main()
List<KeyValue> data = new List<KeyValue>{
Key = "userName", Value = "userNameValue"
Key = "password", Value = "passwordValue"
Key = "domain", Value = "domainValue"
Dictionary<string, string> dict = data.ToDictionary(x => x.Key, x => x.Value);
foreach (var kvp in dict)
Console.WriteLine($"Key: {kvp.Key}, Value: {kvp.Value}");
public string Key {get;set;}
public string Value {get;set;}