int AddBeforeAfterGenericInvokerCall(int index, PropertyDefinition property)
{
var beforeVariable = new VariableDefinition(property.PropertyType);
setMethodBody.Variables.Add(beforeVariable);
var afterVariable = new VariableDefinition(property.PropertyType);
setMethodBody.Variables.Add(afterVariable);
index = InsertVariableAssignmentFromCurrentValue(index, property, afterVariable);
index = instructions.Insert(index,
Instruction.Create(OpCodes.Ldarg_0),
Instruction.Create(OpCodes.Ldstr, property.Name),
Instruction.Create(OpCodes.Ldloc, beforeVariable),
Instruction.Create(OpCodes.Ldloc, afterVariable),
CallEventInvoker(property)
);
return AddBeforeVariableAssignment(index, property, beforeVariable);
}