public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext.IsChildAction) { DocumentStoreHolder.TrySetSession(filterContext.Controller, (IDocumentSession)filterContext.HttpContext.Items[this]); return; } filterContext.HttpContext.Items[this] = DocumentStoreHolder.TryAddSession(filterContext.Controller); }
public override void OnActionExecuted(ActionExecutedContext filterContext) { if (filterContext.IsChildAction) { return; } DocumentStoreHolder.TryComplete(filterContext.Controller, filterContext.Exception == null); if (filterContext.Exception != null && filterContext.ExceptionHandled == false) { throw filterContext.Exception; } }