replaysMike / AnyDiff

A CSharp (C#) diff library that allows you to diff two objects and get a list of the differences back.
Other
160 stars 17 forks source link

Reversing left and right objects in call to `Diff` changes the `diff.PropertyType` returned (but not `Property`) #30

Open malclear opened 3 months ago

malclear commented 3 months ago

I diff'ed two instance of Order where a new OrderDetail instance had been added to the array of one: changedOrder. If the originalOrder was on the left in the function call, then the resulting diff.PropertyType evaluated to "System.Collections.Generic.List'1[Models.OrderDetail]", as expected. --> However, ifchangedOrder was on the left, then the diff.Property type evaluated to "Models.OrderDetail".

Note that in both cases, the diff.Property value was "OrderDetails" (with an 's'), which is the collection variable's name.

image image

malclear commented 3 months ago

If you tell me the intended functionality, I might be able to open a PR for you.