找不到使用模板'~/entityset/key'为 OData 路径选择操作的路由约定



我有一个API,对于以下方案的所有方法都可以正常工作,除了发布给IIS时更新方法。当我使用时,API的本地路径为http://localhost:87/call to api并成功更新了客户当我将API路径更改为http://ipaddress或机器名称:87/提琴手中有错误Innererror: 消息=未发现路由约定可以选择使用模板'〜/Entity Setity/键的O数据路径的操作。消息=没有发现与请求URI'http://ipaddress或Machine名称:87/Evolution/customer(客户的GUID(匹配的HTTP资源'。以下是Ajax调用:

            $.ajax({
            url: webServiceUrl + "/evol/Customers(" + customerId + ")",
            type: "PATCH",
            data: customer,
            crossDomain: true,
            xhrFields: {
                withCredentials: true
            },
            dataType: 'json',

            success: function (result) {
                debugger;
                alert(result.value);
            },
            error: function (result, request, status, error) {
                alert(error);
            }
        });

我通过在API侧的单独控制器中添加此方法来解决此问题。

最新更新