我最近将OData从(v5.9.1)更新到最新的稳定版本(v6.0.0),在前一个我用来配置我的环境如下:
//Allows calling the Url like {entityAction}/{id}
config.SetUrlConventions(ODataUrlConventions.KeyAsSegment);
//Allows urls to be case insensitive
config.EnableCaseInsensitive(true);
// Remove the necessity of having to specify the namespace of enums.
config.EnableEnumPrefixFree(true);
//This allows call a function without using the full namespace.
config.EnableUnqualifiedNameCall(true);
config.MapODataServiceRoute("odata", "api/rest",
edmModel, new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
Run Code Online (Sandbox Code Playgroud)
现在更新后,我怎样才能达到和以前相同的效果?没有我的路线例如:'localhost/odata/people /'正在工作它显示以下消息:
The path template 'people/{parentId}/emails' on the action 'Get' in controller 'PersonEmails' is not a valid OData path template. The operation import overloads matching 'people' are invalid. This is most likely an error in the …Run Code Online (Sandbox Code Playgroud)