You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
574 B
C#
19 lines
574 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Routing;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Txgy.EWS.Server.Start.GlobalRoute
|
|
{
|
|
public static class MvcOptionsExtensions
|
|
{
|
|
public static void UseCentralRoutePrefix(this MvcOptions opts, IRouteTemplateProvider routeAttribute)
|
|
{
|
|
// 添加我们自定义 实现IApplicationModelConvention的RouteConvention
|
|
opts.Conventions.Insert(0, new RouteConvention(routeAttribute));
|
|
}
|
|
}
|
|
}
|