After upgrading to net5 I'm getting obsoletion warning:
[CS0618] 'HttpRequestMessage.Properties' is obsolete: 'Use Options instead.'
however there seems to be no migration guide.
I.e. there's following code
httpRequestMessage.Properties.Add(Key, Value);
How exactly it should be migrated? Is
httpRequestMessage.Options.Set(new HttpRequestOptionsKey<TValue>(Key), Value);
correct?
Options
property, of typeHttpRequestOptions
, is anIDictionary<string, object>
, as theProperties
property... – AbettorhttpRequestMessage.Options.Set<string>(new HttpRequestOptionsKey<string>("100"), "10");
,httpRequestMessage.Options.Set<float>(new HttpRequestOptionsKey<float>("100"), 10.0f);
etc. – Abettor