Is there a way to convert a dynamic or anonymous object to a strongly typed, declared object?
问题 If I have a dynamic object, or anonymous object for that matter, whose structure exactly matches that of a strongly typed object, is there a .NET method to build a typed object from the dynamic object? I know I can use a LINQ dynamicList.Select(dynamic => new Typed { .... } type thing, or I can use Automapper, but I'm wondering if there is not something specially built for this? 回答1: You could serialize to an intermediate format, just to deserialize it right thereafter. It's not the most