Is there a “LINQ” way to do this?
var array = new string[] { "BASE TABLE", "Table", "VIEW", "View" };
var list = array.ToList();
var dictionary = new Dictionary<string, string>();
for (int i = 0; i < list.Count; i += 2)
{
dictionary[list[i]] = list[i + 1];
}
1 Answer