namespace Implab.Diagnostics { public static class Extensions { public static IPromise EndLogicalOperation(this IPromise promise) { Safe.ArgumentNotNull(promise, "promise"); var op = TraceContext.Instance.DetachLogicalOperation(); return promise.Anyway(() => { TraceContext.Instance.EnterLogicalOperation(op,true); TraceLog.EndLogicalOperation(); TraceContext.Instance.Leave(); }); } } }