Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# OData.Simple.Client Linking“;尝试访问该方法失败。”;_C#_Api_Rest_Exception_Odata - Fatal编程技术网

C# OData.Simple.Client Linking“;尝试访问该方法失败。”;

C# OData.Simple.Client Linking“;尝试访问该方法失败。”;,c#,api,rest,exception,odata,C#,Api,Rest,Exception,Odata,我正在尝试使用OData.Simple.Client链接我的条目 public async Task AddGenresAsnyc(int UserID, List<Genre> Genres) { await client.For<User>.Key(UserID).LinkEntryAsync(x => x.Genres, Genres); } public异步任务AddGenresAsnyc(int-UserID,Li

我正在尝试使用OData.Simple.Client链接我的条目

    public async Task AddGenresAsnyc(int UserID, List<Genre> Genres)
    {
        await client.For<User>.Key(UserID).LinkEntryAsync(x => x.Genres, Genres);
    }
public异步任务AddGenresAsnyc(int-UserID,List-Genres)
{
等待client.For.Key(UserID).LinkEntryAsync(x=>x.Genres,Genres);
}
这是我用来做这件事的方法。但是,当我运行它时,它会抛出异常

“尝试访问该方法失败。”


有人知道吗?

您的控制器中定义了任何相关操作吗?没有,但在教程中没有提到。我创建了一个。它在我这边工作得很好。这对我没有帮助,不是吗?我在调用UnlinkEntryAsync时遇到了相同的异常。有人找到解决方案/解决方法吗?