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

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