我正在使用JetBrains Rider进行C#编程,并且我猜想在使用ReSharper时也会出现此警告:
我写了这个函数GetTicket:
public async Task<IEnumerable<Ticket>> GetTicket(int id)
{
return await _memoryCache.GetOrCreateAsync(_cachingFunctionalty.BuildCachingName(id), entry =>
{
entry.SlidingExpiration = TimeSpan.FromSeconds(10);
return GetTicket_uncached(id);
});
}
和GetTicket_uncached,它称为:
private async Task<IEnumerable<Ticket>> GetTicket_uncached(int id)
{
RestClient client = new RestClient(ServiceAdress);
Request req = new Request
{
Method = Method.GET,
Resource = "api/tickets/get",
Parameters = new {ident = id}
};
return await client.ExecuteRequestAsync<Ticket[]>(req);
}
因此,id方法中的参数public async Task<IEnumerable<Ticket>> GetTicket(int id)会以以下警告突出显示:
关闭分配:“ id”参数和“ this”参考
在谷歌搜索时发现了一些东西,但我仍然不知道这意味着什么,这是什么问题?
慕村9548890
慕的地8271018
相关分类