小编Bru*_*uno的帖子

如何在OData v6.0.0中启用EnableCaseInsensitive,EnableEnumPrefixFree和EnableUnqualifiedNameCall

我最近将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)

url-routing odata

5
推荐指数
1
解决办法
1850
查看次数

标签 统计

odata ×1

url-routing ×1