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
Slightly more modular version of svick's answer, using a couple extension methods:
public static class Extensions
{
public static void AddRange(this ICollection collection, IEnumerable items)
{
foreach (var item in items)
{
collection.Add(item);
}
}
public static dynamic ToDynamicObject(this IDictionary source)
{
ICollection> someObject = new ExpandoObject();
someObject.AddRange(source);
return someObject;
}
}