Simplify.Web engine root
Inheritance: Microsoft.Owin.OwinMiddleware
        /// <summary>
        /// Adds Simplify.Web to OWIN pipeline
        /// </summary>
        /// <param name="builder">The OWIN builder.</param>
        /// <returns></returns>
        public static IAppBuilder UseSimplifyWeb(this IAppBuilder builder)
        {
            try
            {
                BootstrapperFactory.CreateBootstrapper().Register();
                return(builder.Use <SimplifyWebOwinMiddleware>());
            }
            catch (Exception e)
            {
                SimplifyWebOwinMiddleware.ProcessOnException(e);

                throw;
            }
        }
        private static void Register(IApplicationBuilder builder)
        {
            builder.Use(async(context, next) =>
            {
                var result = SimplifyWebOwinMiddleware.Invoke(context);

                await result.Task;

                if (result.Status == RequestHandlingStatus.RequestWasUnhandled)
                {
                    await next.Invoke();
                }
            });
        }
        /// <summary>
        /// Adds Simplify.Web to the OWIN pipeline as a non-terminal middleware without bootstrapper registrations
        /// </summary>
        /// <param name="builder">The OWIN builder.</param>
        /// <returns></returns>
        public static IApplicationBuilder UseSimplifyWebNonTerminalWithoutRegistrations(this IApplicationBuilder builder)
        {
            try
            {
                TerminalMiddleware = false;

                Register(builder);

                return(builder);
            }
            catch (Exception e)
            {
                SimplifyWebOwinMiddleware.ProcessOnException(e);

                throw;
            }
        }
        /// <summary>
        /// Performs Simplify.Web bootstrapper registrations and adds Simplify.Web to the OWIN pipeline as a non-terminal middleware
        /// </summary>
        /// <param name="builder">The OWIN builder.</param>
        /// <returns></returns>
        public static IApplicationBuilder UseSimplifyWebNonTerminal(this IApplicationBuilder builder)
        {
            try
            {
                TerminalMiddleware = false;
                BootstrapperFactory.CreateBootstrapper().Register();

                Register(builder);

                return(builder);
            }
            catch (Exception e)
            {
                SimplifyWebOwinMiddleware.ProcessOnException(e);

                throw;
            }
        }
 private static void RegisterAsTerminal(IApplicationBuilder builder)
 {
     builder.Run(async(context) => await SimplifyWebOwinMiddleware.Invoke(context).Task);
 }