Пример #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));
        }