internal static AuditScope GetCurrentScope(HttpContext httpContext) { if (httpContext == null) { return(AuditScopeFactory.CreateNoOp()); } return(httpContext.Items[AuditApiHelper.AuditApiScopeKey] as AuditScope); }
internal static AuditScope GetCurrentScope(HttpRequestMessage request, IContextWrapper contextWrapper) { if (request == null) { return(AuditScopeFactory.CreateNoOp()); } var ctx = contextWrapper ?? new ContextWrapper(request); return(ctx.Get <AuditScope>(AuditApiHelper.AuditApiScopeKey)); }