private bool InstrumentGate(IGate gate, string operation, object thing, Func <IGate, bool> function) { var payload = new InstrumentationPayload { FeatureName = Name, GateName = gate.Name, Operation = operation, Thing = thing, }; using (Instrumenter.InstrumentGate(payload)) { var result = function(gate); payload.Result = result; return(result); } }