网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

netcore webapi 设置路由教程

时间:2024-10-12 05:47:57

1、在配置前我们先来看看接口的前缀吧

netcore webapi 设置路由教程

3、我们酋篚靶高需要用到IApplicationModelConvention 这个接口,它是位于Microsoft.AspNetCore.Mvc.ApplicationModels 命令空间下面。

netcore webapi 设置路由教程

5、先定义一个类,用来实现IApplicationModelConvention 接口。

netcore webapi 设置路由教程netcore webapi 设置路由教程

7、在startup.cs 里面ConfigureServices 方法添加配置信息

netcore webapi 设置路由教程

9、把原先的路由前缀去除

netcore webapi 设置路由教程
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com