/// <summary> /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class. /// </summary> /// <param name="httpClient">The <see cref="HttpClient"/> used for request to the webservice.</param> public MusicBrainzClient(HttpClient httpClient) { var urlBuilder = new UrlBuilder(true); Artists = new ArtistService(this, urlBuilder); Recordings = new RecordingService(this, urlBuilder); Releases = new ReleaseService(this, urlBuilder); ReleaseGroups = new ReleaseGroupService(this, urlBuilder); Work = new WorkService(this, urlBuilder); client = httpClient; }
/// <summary> /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class. /// </summary> /// <param name="baseAddress">The base address of the webservice (default = <see cref="ServiceBaseAddress"/>).</param> /// <param name="proxy">The <see cref="IWebProxy"/> used to connect to the webservice.</param> public MusicBrainzClient(string baseAddress, IWebProxy proxy) { var urlBuilder = new UrlBuilder(true); Artists = new ArtistService(this, urlBuilder); Recordings = new RecordingService(this, urlBuilder); Releases = new ReleaseService(this, urlBuilder); ReleaseGroups = new ReleaseGroupService(this, urlBuilder); Work = new WorkService(this, urlBuilder); client = CreateHttpClient(new Uri(baseAddress), true, proxy); }