Comparing 2 objects and retrieve a list of fields with different values

前端 未结 2 1693
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 07:05

Given a class with 35 fields and 2 objects with a certain number of different fields value. Is there an clever way to get a list with the fields name where the ob

2条回答
  •  失恋的感觉
    2020-11-29 07:43

    Reflection is the way to go with this and I don't think 35 fields is a problem.

    (After confusing myself utterly I come back to thinking that I understand the question and reflection would be fine for this).

提交回复
热议问题