Comparing dynamic objects in C#

前端 未结 6 2425
不知归路
不知归路 2021-02-13 04:08

What is the best way to compare two arbitrary dynamic objects for equality? For example these two objects.

I.e.

dynamic obj1 = new ExpandoObject();
obj1.         


        
6条回答
  •  萌比男神i
    2021-02-13 04:10

    See "Enumerating and deleting members" to get the members of an ExpandoObject http://msdn.microsoft.com/en-us/library/system.dynamic.expandoobject.aspx

    Arbitrary dynamic objects do not appear to expose enumerators, though.

提交回复
热议问题