First, and to make things clearer I\'ll explain my scenario from the top:
I have a method which has the following signature:
public virtual void Send
The credit here goes to the accepted answer. Adding this because I wanted to turn a List< Dictionary< string,object >> into a List< dynamic>. The purpose is for pulling records from a database table. Here is what I did.
public static List ListDictionaryToListDynamic(List> dbRecords)
{
var eRecords = new List();
foreach (var record in dbRecords)
{
var eRecord = new ExpandoObject() as IDictionary;
foreach (var kvp in record)
{
eRecord.Add(kvp);
}
eRecords.Add(eRecord);
}
return eRecords;
}