/// <summary> /// Enables FlashMessages for the Nancy application, using the provided /// configuration /// </summary> /// <param name="pipelines"></param> /// <param name="configuration"></param> public static void Enable(IPipelines pipelines, FlashMessagesConfiguration configuration) { pipelines.BeforeRequest.AddItemToEndOfPipeline(ctx => { ctx.SetFlashMessages(new FlashMessages(ctx.Request.Session, configuration)); return(null); }); }
/// <summary> /// Enables FlashMessages for the Nancy application, using the provided /// configuration /// </summary> /// <param name="pipelines"></param> /// <param name="configuration"></param> public static void Enable(IPipelines pipelines, FlashMessagesConfiguration configuration) { pipelines.BeforeRequest.AddItemToEndOfPipeline(ctx => { ctx.SetFlashMessages(new FlashMessages(ctx.Request.Session, configuration)); return null; }); }
/// <summary> /// Constructor /// </summary> /// <param name="session"></param> /// <param name="configuration"></param> public FlashMessages(ISession session, FlashMessagesConfiguration configuration) { if (session == null) { throw new ArgumentNullException("session", "You need to initialise a session provider in your Nancy Bootstrapper in order to use FlashMessages"); } if (configuration == null) { throw new ArgumentNullException("configuration"); } _session = session; _configuration = configuration; }
public DefaultFlashMessageRenderer(FlashMessagesConfiguration configuration) { _configuration = configuration; }