예제 #1
0
        internal static AuditScope GetCurrentScope(HttpContext httpContext)
        {
            if (httpContext == null)
            {
                return(AuditScopeFactory.CreateNoOp());
            }

            return(httpContext.Items[AuditApiHelper.AuditApiScopeKey] as AuditScope);
        }
예제 #2
0
        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));
        }