src/AspNetCore/src/XperienceStatusCodePagesExtensions.cs
/// <summary> Adds a StatusCodePages middleware to the pipeline. Specifies that responses should be handled by redirecting to a document in the Xperience Content Tree. </summary>
Adds a StatusCodePages middleware to the pipeline. Specifies that responses should be handled by redirecting to a document in the Xperience Content Tree.
Adds a StatusCodePages middleware to the pipeline . Specifies that responses should be handled by redirecting to a document in the Xperience Content Tree .
public static IApplicationBuilder UseXperienceStatusCodePagesWithRedirects( this IApplicationBuilder app )
        {
            if( app == null )
            {
                throw new ArgumentNullException( nameof( app ) );
            }
            return app.UseStatusCodePages(
                async context =>
                {
                    var path = await GetStatusCodePathAsync( context.HttpContext );
                    if( !string.IsNullOrEmpty( path ) )
                    {
                        context.HttpContext.Response.Redirect( context.HttpContext.Request.PathBase + path );
                    }
                }
            );
        }
public static IApplicationBuilder UseXperienceStatusCodePagesWithRedirects ( this IApplicationBuilder app ) { if ( app == null ) { throw new ArgumentNullException ( nameof ( app ) ) ; } return app . UseStatusCodePages ( async context => { var path = await GetStatusCodePathAsync ( context . HttpContext ) ; if ( ! string . IsNullOrEmpty ( path ) ) { context . HttpContext . Response . Redirect ( context . HttpContext . Request . PathBase + path ) ; } } ) ; }
Adds a StatusCodePages middleware to the pipeline.
Adds a StatusCodePages middleware to the pipeline .
IApplicationBuilder
this