本文整理汇总了C#中IApplicationBuilder.UseErrorReporter方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseErrorReporter方法的具体用法?C# IApplicationBuilder.UseErrorReporter怎么用?C# IApplicationBuilder.UseErrorReporter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplicationBuilder
的用法示例。
在下文中一共展示了IApplicationBuilder.UseErrorReporter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "isbn10",
template: "book/{action}/{isbnNumber:IsbnDigitScheme10(true)}",
defaults: new { controller = "InlineConstraints_Isbn10" });
routes.MapRoute("StoreId",
"store/{action}/{id:guid?}",
defaults: new { controller = "InlineConstraints_Store" });
routes.MapRoute("StoreLocation",
"store/{action}/{location:minlength(3):maxlength(10)}",
defaults: new { controller = "InlineConstraints_Store" },
constraints: new { location = new AlphaRouteConstraint() });
// Used by tests for the 'exists' constraint.
routes.MapRoute("areaExists-area", "area-exists/{area:exists}/{controller=Home}/{action=Index}");
routes.MapRoute("areaExists", "area-exists/{controller=Home}/{action=Index}");
routes.MapRoute("areaWithoutExists-area", "area-withoutexists/{area}/{controller=Home}/{action=Index}");
routes.MapRoute("areaWithoutExists", "area-withoutexists/{controller=Home}/{action=Index}");
});
}
示例2: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
app.UseMvc(routes =>
{
routes.MapRoute("areaRoute",
"{area:exists}/{controller}/{action}",
new { controller = "Home", action = "Index" });
routes.MapRoute("ActionAsMethod", "{controller}/{action}",
defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(
"products",
"api/Products/{country}/{action}",
defaults: new { controller = "Products" });
// Added this route to validate that we throw an exception when a conventional
// route matches a link generated by a named attribute route.
// The conventional route will match first, but when the attribute route generates
// a valid route an exception will be thrown.
routes.MapRoute(
"DuplicateRoute",
"conventional/Duplicate",
defaults: new { controller = "Duplicate", action = "Duplicate" });
routes.MapRoute(
"RouteWithOptionalSegment",
"{controller}/{action}/{path?}");
});
}
示例3: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
// Add MVC to the request pipeline
app.UseMvcWithDefaultRoute();
}
示例4: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
app.UseMiddleware<AuthorizeBasicMiddleware>("Interactive");
app.UseMiddleware<AuthorizeBasicMiddleware>("Api");
app.UseMvcWithDefaultRoute();
}
示例5: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
app.UseMvc(routes =>
{
routes.MapRoute("ActionAsMethod", "{controller}/{action}",
defaults: new { controller = "Home", action = "Index" });
});
}
示例6: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorReporter();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}");
});
}