I would like to know if there is a way to create a custom class out of an existing class in this manner:
original class:
public class Person { string name; } later in code:
var diffPerson = CreateDiffClass<Person>(); diffPerson.name.Value = "name"; diffPerson.name.Changed = false; this diffPerson is not of Person type, instead it is custom created one, that for every variable in Person have one in itself so that the new variable is a tuple where T is the type of the variable.
I want it to create a system for comparing 2 instances of the same class. one old instance and one new and save the new value and if it changed
I don't really know how to describe it except showing in this example so I hope it is understandable..
I want this to be generic and work on any given class
Thanks
later in codewon't even compile.ValueorChanged, none of them are members ofstring. According to your code, they even contain different values. Are you talking about class inheritance? Maybe you are talking about an interface or so.. ?