I am working on a winforms application using C#. I have a dictionary with specific objects, the object have attributes Id and DocType. How can i access the attributes of every object in a foreach statement. i Am trying with the following code but is not working. Any help pls?
foreach (var doc in crs.DocDictionary)
{
Console.WriteLine( doc.Id);
Console.WriteLine(doc.docType);
}
If you
foreachon a dictionary you get a sequence ofKeyValuePair<TKey,TValue>; try:or: