Closed S9yN37 closed 4 years ago
Hi @S9yN37. Thank you for your work making this pull request. There are some issues I see here.
Compare lists by content I've already been thinking about adding this feature. But people may want to compare lists very differently. Objects has keys and order doesn't matter, Objects has keys and order matters, no specific key but all combination of all members is a key (think about list of points on the surface with x and y properties) and again sometimes order matter and sometimes doesn't.
Custom names for objects and members
Can you please tell a bit more about your usecase?
I really appreciate your work.
Hi @ValeraT1982, I want to implement history changes for Reservations (hotel, flight, transfers...). See attached image. Objects are very large and I wanted to easily compare content by implementing IComparableEnumerableItem in each item. With group, I wanted to split differences in sections as there are rendered in the UI. Propery custom name, to overwirte the defatult name of the propery. Please see example 5. And in the end I wanted to turn the differences into an history object (section, field, action, old, new). I couldn't figure out how to do all of this with the default functionality, especially part with sections and property names. Thank you for the reply and congratulations on the project, impressive work.
@S9yN37, to accomplish this you can implement converter PathToNameConverter. As far as you have path to the property and the type of the root object you can read attributes of the property(to read custom name) and attributes of the class (section name).
Example: path: ReservationDetails.Rooms[1].Type
Thank you
Compare list and track add, update and delete using ComparableEnumerablesComparer and IComparableEnumerableItem. Custom member names and group diferences.
Comparison Settings GroupNameAttribute Attribute type used to groups differences
MemberCustomNameAttribute Attribute type used to define custom names for properties