Exemplo n.º 1
0
 public JsonExceptionMiddleware(OwinMiddleware next, ExceptionMiddlewareConfig config)
     : base(next)
 {
     _log = config.Log;
     _isDetailsEnabled = config.EnableDetails;
     _contractResolver = config.ContractResolver ?? new DefaultContractResolver();
 }
Exemplo n.º 2
0
        public static IAppBuilder UseJsonException(this IAppBuilder app, ExceptionMiddlewareConfig config = null)
        {
            if (config == null)
            {
                config = new ExceptionMiddlewareConfig();
            }

            if (config.Log == null)
            {
                config.Log = app.GetLoggerFactory().Create(typeof(JsonExceptionMiddleware).FullName);
            }

            app.Use <JsonExceptionMiddleware>(config);
            return(app);
        }
        public static IAppBuilder UseJsonException(this IAppBuilder app, ExceptionMiddlewareConfig config = null)
        {
            if (config == null)
            {
                config=new ExceptionMiddlewareConfig();
            }

            if (config.Log == null)
            {
                config.Log = app.GetLoggerFactory().Create(typeof (JsonExceptionMiddleware).FullName);
            }

            app.Use<JsonExceptionMiddleware>(config);
            return app;
        }
 public JsonExceptionMiddleware(OwinMiddleware next, ExceptionMiddlewareConfig config)
     : base(next)
 {
     log = config.Log;
     isDetailsEnabled = config.EnableDetails;
 }
Exemplo n.º 5
0
 public JsonExceptionMiddleware(OwinMiddleware next, ExceptionMiddlewareConfig config)
     : base(next)
 {
     log = config.Log;
     isDetailsEnabled = config.EnableDetails;
 }