This commit is contained in:
Bogdan 2026-05-03 17:04:13 +03:00 committed by GitHub
commit 55ad34efc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,12 +101,14 @@ public override string ToString()
public class HttpResponse<T> : HttpResponse
where T : new()
{
private readonly Lazy<T> _resource;
public HttpResponse(HttpResponse response)
: base(response.Request, response.Headers, response.ResponseData, response.StatusCode, response.Version)
{
Resource = Json.Deserialize<T>(response.Content);
_resource = new Lazy<T>(() => Json.Deserialize<T>(response.Content));
}
public T Resource { get; private set; }
public T Resource => _resource.Value;
}
}