Esempio n. 1
0
        public static IApplicationBuilder UseJsonException(this IApplicationBuilder app, ExceptionMiddlewareConfig config = null)
        {
            if (config == null)
            {
                config = new ExceptionMiddlewareConfig();
            }

            app.UseMiddleware <JsonExceptionMiddleware>(config);
            return(app);
        }
Esempio n. 2
0
 public JsonExceptionMiddleware(RequestDelegate next, ILogger <JsonExceptionMiddleware> log, ExceptionMiddlewareConfig config)
 {
     _next             = next;
     _log              = log;
     _isDetailsEnabled = config.EnableDetails;
 }
Esempio n. 3
0
 public JsonExceptionMiddleware(RequestDelegate next, ILogger <JsonExceptionMiddleware> log, ExceptionMiddlewareConfig config)
 {
     _next             = next;
     _log              = log;
     _isDetailsEnabled = config.EnableDetails;
     _contractResolver = config.ContractResolver ?? new DefaultContractResolver();
 }