I am using record
from C# 9, for example
public record Receipt
{
public string ClientName { get; init; } = "";
public string ClientPhoneNumber { get; init; } = "";
public List<OtherRecord> OtherInfo { get; init; } = new();
}
and would like a function to compare 2 instances of that type and return a list of all values that are not identical on both sides (for auditing purpose).
I suppose it would use reflection so it can support any record type, without hardcoding the properties names?