mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Merge 19bd9c9448 into bf5d48c76a
This commit is contained in:
commit
55ad34efc4
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue