首页 > 解决方案 > How to change route name in .NET Odata?

问题描述

I have build some odata function in .NET.

Now each entity url like below:

http://1.1.1.1/APIName/odata/Products

I want to remove "/odata" words in the url. Like below:

http://1.1.1.1/APIName/Products

How to modify it?

标签: .netentity-framework

解决方案


好的..我找到了解决方案。

如下更新设置后,它按我的意愿工作。

config.Routes.MapODataServiceRoute("odata", "", builder.GetEdmModel());

推荐阅读