DatabaseErrorPageMiddleware Constructor

Definition

Caution

This is obsolete and will be removed in a future version. Use DatabaseDeveloperPageExceptionFilter instead, see documentation at https://aka.ms/DatabaseDeveloperPageExceptionFilter.

Initializes a new instance of the DatabaseErrorPageMiddleware class

C#
public DatabaseErrorPageMiddleware (Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.DatabaseErrorPageOptions> options);
C#
[System.Obsolete("This is obsolete and will be removed in a future version. Use DatabaseDeveloperPageExceptionFilter instead, see documentation at https://aka.ms/DatabaseDeveloperPageExceptionFilter.")]
public DatabaseErrorPageMiddleware (Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.DatabaseErrorPageOptions> options);

Parameters

next
RequestDelegate

Delegate to execute the next piece of middleware in the request pipeline.

loggerFactory
ILoggerFactory

The ILoggerFactory for the application. This middleware both produces logging messages and consumes them to detect database related exception.

options
IOptions<DatabaseErrorPageOptions>

The options to control what information is displayed on the error page.

Attributes

Applies to

Product Versions (Obsolete)
ASP.NET Core 3.0, 3.1 (5.0, 6.0, 7.0, 8.0, 9.0)