Create anonymous object by Reflection in C#
Yes, there is. From memory:
public static T create<T>(T t)
{
return Activator.CreateInstance<T>();
}
object anon = create(existingAnonymousType);
Here is another way, seems more direct.
object anon = Activator.CreateInstance(existingObject.GetType());