Tidying ApiBase class

This commit is contained in:
Rikki Tooley 2016-11-30 03:34:31 +00:00
parent 380b17a333
commit 440577c0c1

View File

@ -6,17 +6,14 @@ namespace IF.Lastfm.Core.Helpers
{
public abstract class ApiBase : IDisposable
{
public ILastAuth Auth { get; protected set; }
private readonly bool _isHttpClientOwner;
private readonly HttpClient _httpClient;
public ILastAuth Auth { get; protected set; }
/// <summary>
/// The HttpClient that will be used by this API. If it is provided through the ApiBase constructor then it should be disposed explicitly.
/// </summary>
public HttpClient HttpClient
{
get { return _httpClient; }
}
public HttpClient HttpClient { get; }
protected ApiBase(HttpClient httpClient = null)
{
@ -30,7 +27,7 @@ protected ApiBase(HttpClient httpClient = null)
_isHttpClientOwner = true;
}
_httpClient = httpClient;
HttpClient = httpClient;
}
public virtual void Dispose()