You need to obtain a
FieldInfo instance for the property's backing field and call the
Mono.Reflection library (available in Package Manager) will help you find the backing field.
If the Property is an auto-property, you can call the
GetBackingField() extension method on the
Otherwise, you'll have to disassemble the IL of the
MethodInfo of the getter like this:
var instructions = yourProp.GetGetMethod().GetInstructions();
This will give you a list of the method's IL instructions. If they look like this:
Ldfld (Backing Field)
Then the 2nd Instruction will give you the backing field. In code:
if (instructions.Count == 3 && instructions.OpCode == OpCodes.Ldarg_0 && instructions.OpCode == OpCodes.Ldfld && instructions.OpCode == OpCodes.Ret)
FieldInfo backingField = (FieldInfo)instructions.Operand;
Otherwise, the property is probably computed and has no backing field.