public LazyJson(HttpResponseMessage response)
=> this.Response = response;
- internal LazyJson(T instance)
- {
- this.Response = null;
-
- this.instance = instance;
- this.completed = true;
- }
-
public async Task<T> LoadJsonAsync()
{
if (this.completed)
=> this.Response?.Dispose();
}
- public static class LazyJson
- {
- public static LazyJson<T> Create<T>(T instance)
- => new(instance);
- }
-
public static class LazyJsonTaskExtension
{
public static async Task IgnoreResponse<T>(this Task<LazyJson<T>> task)