升级到 net5 后,我收到过时警告:
[CS0618] 'HttpRequestMessage.Properties' is obsolete: 'Use Options instead.'
但是似乎没有迁移指南。
即有以下代码
httpRequestMessage.Properties.Add(Key, Value);
Run Code Online (Sandbox Code Playgroud)
具体应该如何迁移呢?是
httpRequestMessage.Options.Set(new HttpRequestOptionsKey<TValue>(Key), Value);
Run Code Online (Sandbox Code Playgroud)
正确的?