internal static void Enable(this IPipelines pipelines, IInProcSessionManager sessionManager) {
      if (pipelines == null) throw new ArgumentNullException("pipelines");
      if (sessionManager == null) throw new ArgumentNullException("sessionManager");

      pipelines.BeforeRequest.AddItemToStartOfPipeline(ctx => LoadSession(ctx, sessionManager));
      pipelines.AfterRequest.AddItemToEndOfPipeline(ctx => SaveSession(ctx, sessionManager));
    }
        internal static void Enable(this IPipelines pipelines, IInProcSessionManager sessionManager)
        {
            if (pipelines == null)
            {
                throw new ArgumentNullException("pipelines");
            }
            if (sessionManager == null)
            {
                throw new ArgumentNullException("sessionManager");
            }

            pipelines.BeforeRequest.AddItemToStartOfPipeline(ctx => LoadSession(ctx, sessionManager));
            pipelines.AfterRequest.AddItemToEndOfPipeline(ctx => SaveSession(ctx, sessionManager));
        }
 private static Response SaveSession(NancyContext ctx, IInProcSessionManager sessionManager)
 {
     sessionManager.Save(ctx.Request.Session, ctx);
     return(null);
 }
 private static Response LoadSession(NancyContext ctx, IInProcSessionManager sessionManager)
 {
     ctx.Request.Session = sessionManager.Load(ctx);
     return(null);
 }
 public InProcSessionsFixture() {
   _fakeSessionManager = A.Fake<IInProcSessionManager>();
 }
Exemplo n.º 6
0
 public InProcSessionsFixture()
 {
     _fakeSessionManager = A.Fake <IInProcSessionManager>();
 }
 private static Response SaveSession(NancyContext ctx, IInProcSessionManager sessionManager) {
   sessionManager.Save(ctx.Request.Session, ctx);
   return null;
 }
 private static Response LoadSession(NancyContext ctx, IInProcSessionManager sessionManager) {
   ctx.Request.Session = sessionManager.Load(ctx);
   return null;
 }