When an extension method such as ReadFromJsonAsync is called, the syntax is like instance methods
return await response.Content.ReadFromJsonAsync(
but this requires a using using System.Net.Http.Json.
Sure I could call it via the static method way and if I do this, the using will be added, but I want the code to be written in the "instance method-like" way.
BTW if I use Usings component to add this using, and the code has another part using a class from the same namespace, we will see duplicated using statements.
When an extension method such as
ReadFromJsonAsyncis called, the syntax is like instance methodsbut this requires a using
using System.Net.Http.Json.Sure I could call it via the static method way and if I do this, the using will be added, but I want the code to be written in the "instance method-like" way.
BTW if I use
Usingscomponent to add this using, and the code has another part using a class from the same namespace, we will see duplicated using statements.