public static IApplicationBuilder UseJsonException(this IApplicationBuilder app, ExceptionMiddlewareConfig config = null) { if (config == null) { config = new ExceptionMiddlewareConfig(); } app.UseMiddleware <JsonExceptionMiddleware>(config); return(app); }
public JsonExceptionMiddleware(RequestDelegate next, ILogger <JsonExceptionMiddleware> log, ExceptionMiddlewareConfig config) { _next = next; _log = log; _isDetailsEnabled = config.EnableDetails; }
public JsonExceptionMiddleware(RequestDelegate next, ILogger <JsonExceptionMiddleware> log, ExceptionMiddlewareConfig config) { _next = next; _log = log; _isDetailsEnabled = config.EnableDetails; _contractResolver = config.ContractResolver ?? new DefaultContractResolver(); }