Comparing dynamic objects in C#

前端 未结 6 2307
不知归路
不知归路 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条回答
  •  渐次进展
    2021-02-13 04:34

    You have to implement IComparable-Interface. Then you have the appropriate functions needed from .NET/C# to compare two objects with each other.

提交回复
热议问题