my preview question how to write a if statement
in setterBuilder statement, if i compare new value and old value , there are 3 ways .
- use "op_Inequality" as @DudiKeleti writes.
- use property.PropertyType.GetMethod("Equals" , sometimes there are errors , "System.NullReferenceException"
- use typeof(object).GetMethod("Equals" .
what's my question.
some data type , for example , int , doesn't has "op_Inequality" , what should i do then ?
if i use typeof(object).GetMethod , i should alse use debug model ,otherwise, there are errors , System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
can somebody help me with the problems ?
update 1
i got a screen-snap .
Thanks everyone. I got a reference to EntityProxyFactory. It's helpful and my code is below.
I hope my code will help you.