diff --git a/src/Hqub.MusicBrainz.API/Configuration.cs b/src/Hqub.MusicBrainz.API/Configuration.cs
new file mode 100644
index 000000000..f8b1da755
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Configuration.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hqub.MusicBrainz.API
+{
+ public static class Configuration
+ {
+ static Configuration()
+ {
+ GenerateCommunicationThrow = true;
+ Proxy = null;
+ UserAgent = "Hqub.MusicBrainz/2.0";
+ }
+
+ ///
+ /// If true, then all exceptions for http-requests to MusicBrainz (from class WebRequestHelper) will
+ /// throw up. Otherwise they will be suppressed.
+ ///
+ public static bool GenerateCommunicationThrow { get; set; }
+
+
+ ///
+ /// Gets or sets a used to query the webservice.
+ ///
+ public static IWebProxy Proxy { get; set; }
+
+ ///
+ /// Allow set cutstom user agent string.
+ ///
+ public static string UserAgent { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Artist.cs b/src/Hqub.MusicBrainz.API/Entities/Artist.cs
new file mode 100644
index 000000000..8691df73e
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Artist.cs
@@ -0,0 +1,204 @@
+using System;
+using System.Threading.Tasks;
+using System.Xml.Serialization;
+using Hqub.MusicBrainz.API.Entities.Collections;
+using Hqub.MusicBrainz.API.Entities.Metadata;
+
+namespace Hqub.MusicBrainz.API.Entities
+{
+ [XmlRoot("artist", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class Artist : Entity
+ {
+ public const string EntityName = "artist";
+
+ #region Properties
+
+ ///
+ /// Gets or sets the score (only available in search results).
+ ///
+ [XmlAttribute("score", Namespace = "http://musicbrainz.org/ns/ext#-2.0")]
+ public int Score { get; set; }
+
+ ///
+ /// Gets or sets the MusicBrainz id.
+ ///
+ [XmlAttribute("id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets the type.
+ ///
+ [XmlAttribute("type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets the name.
+ ///
+ [XmlElement("name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the sort name.
+ ///
+ [XmlElement("sort-name")]
+ public string SortName { get; set; }
+
+ ///
+ /// Gets or sets the gender.
+ ///
+ [XmlElement("gender")]
+ public string Gender { get; set; }
+
+ ///
+ /// Gets or sets the life-span.
+ ///
+ [XmlElement("life-span")]
+ public LifeSpanNode LifeSpan { get; set; }
+
+ ///
+ /// Gets or sets the country.
+ ///
+ [XmlElement("country")]
+ public string Country { get; set; }
+
+ ///
+ /// Gets or sets the disambiguation.
+ ///
+ [XmlElement("disambiguation")]
+ public string Disambiguation { get; set; }
+
+ ///
+ /// Gets or sets the rating.
+ ///
+ [XmlElement("rating")]
+ public Rating Rating { get; set; }
+
+ #endregion
+
+ #region Subqueries
+
+ [XmlElement("recording-list")]
+ public RecordingList Recordings { get; set; }
+
+ [XmlElement("release-group-list")]
+ public ReleaseGroupList ReleaseGroups { get; set; }
+
+ [XmlElement("release-list")]
+ public ReleaseList ReleaseLists { get; set; }
+
+ [XmlElement("relation-list")]
+ public RelationList RelationLists { get; set; }
+
+ [XmlElement("work-list")]
+ public WorkList Works { get; set; }
+
+ [XmlElement("tag-list")]
+ public TagList Tags { get; set; }
+
+ #endregion
+
+ #region Static Methods
+
+ [Obsolete("Use GetAsync() method.")]
+ public static Artist Get(string id, params string[] inc)
+ {
+ return GetAsync(EntityName, id, inc).Result;
+ }
+
+ [Obsolete("Use SearchAsync() method.")]
+ public static ArtistList Search(string query, int limit = 25, int offset = 0)
+ {
+ return SearchAsync(EntityName,
+ query, limit, offset).Result.Collection;
+ }
+
+ [Obsolete("Use BrowseAsync() method.")]
+ public static ArtistList Browse(string relatedEntity, string value, int limit = 25, int offset = 0, params string[] inc)
+ {
+ return BrowseAsync(EntityName,
+ relatedEntity, value, limit, offset, inc).Result.Collection;
+ }
+
+ ///
+ /// Lookup an artist in the MusicBrainz database.
+ ///
+ /// The artist MusicBrainz id.
+ /// A list of entities to include (subqueries).
+ ///
+ public async static Task GetAsync(string id, params string[] inc)
+ {
+ return await GetAsync(EntityName, id, inc);
+ }
+
+ ///
+ /// Search for an artist in the MusicBrainz database, matching the given query.
+ ///
+ /// The query string.
+ /// The maximum number of artists to return (default = 25).
+ /// The offset to the artists list (enables paging, default = 0).
+ ///
+ public async static Task SearchAsync(string query, int limit = 25, int offset = 0)
+ {
+ return (await SearchAsync(EntityName,
+ query, limit, offset)).Collection;
+ }
+
+ ///
+ /// Search for an artist in the MusicBrainz database, matching the given query.
+ ///
+ /// The query parameters.
+ /// The maximum number of artists to return (default = 25).
+ /// The offset to the artists list (enables paging, default = 0).
+ ///
+ public async static Task SearchAsync(QueryParameters query, int limit = 25, int offset = 0)
+ {
+ return (await SearchAsync(EntityName,
+ query.ToString(), limit, offset)).Collection;
+ }
+
+ ///
+ /// Browse all the artists in the MusicBrainz database, which are directly linked to the
+ /// entity with given id.
+ ///
+ /// The name of the related entity.
+ /// The id of the related entity.
+ /// The maximum number of artists to return (default = 25).
+ /// The offset to the artists list (enables paging, default = 0).
+ /// A list of entities to include (subqueries).
+ ///
+ public async static Task BrowseAsync(string entity, string id, int limit = 25, int offset = 0, params string[] inc)
+ {
+ return (await BrowseAsync(EntityName, entity, id,
+ limit, offset, inc)).Collection;
+ }
+
+ #endregion
+ }
+
+ #region Include entities
+
+ [XmlRoot("life-span", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class LifeSpanNode
+ {
+ ///
+ /// Gets or sets the begin date.
+ ///
+ [XmlElement("begin")]
+ public string Begin { get; set; }
+
+ ///
+ /// Gets or sets the end date.
+ ///
+ [XmlElement("end")]
+ public string End { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the life-span ended or not.
+ ///
+ [XmlElement("ended")]
+ public bool Ended { get; set; }
+ }
+
+ #endregion
+
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/ArtistList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/ArtistList.cs
new file mode 100644
index 000000000..5fcf3ab9a
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/ArtistList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("artist-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class ArtistList : BaseList
+ {
+ ///
+ /// Gets or sets the list of artists.
+ ///
+ [XmlElement("artist")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/BaseList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/BaseList.cs
new file mode 100644
index 000000000..804a87727
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/BaseList.cs
@@ -0,0 +1,25 @@
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ public class BaseList
+ {
+ ///
+ /// Gets or sets the total list items count.
+ ///
+ ///
+ /// This might be different form the actual list items count. If the list was
+ /// generated from a search request, this property will return the total number
+ /// of available items (on the server), while the number of returned items is
+ /// limited by the requests 'limit' parameter (default = 25).
+ ///
+ [XmlAttribute("count")]
+ public int QueryCount { get; set; }
+
+ ///
+ /// Gets or sets the list offset (only available in search requests).
+ ///
+ [XmlAttribute("offset")]
+ public int QueryOffset { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/MediumList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/MediumList.cs
new file mode 100644
index 000000000..54dfe0d51
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/MediumList.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("medium-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class MediumList : BaseList
+ {
+ ///
+ /// Gets or sets the medium track count.
+ ///
+ ///
+ /// Only available in the result of a release search (???).
+ ///
+ [XmlElement(ElementName = "track-count")]
+ public int TrackCount { get; set; }
+
+ ///
+ /// Gets or sets the list of mediums.
+ ///
+ [XmlElement("medium")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/RecordingList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/RecordingList.cs
new file mode 100644
index 000000000..d2f5da68d
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/RecordingList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("recording-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class RecordingList : BaseList
+ {
+ ///
+ /// Gets or sets the list of recordings.
+ ///
+ [XmlElement("recording")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/RelationList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/RelationList.cs
new file mode 100644
index 000000000..8afa952ed
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/RelationList.cs
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("relation-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class RelationList : BaseList
+ {
+ ///
+ /// Gets or sets the relation target type.
+ ///
+ [XmlAttribute("target-type")]
+ public string TargetType { get; set; }
+
+ ///
+ /// Gets or sets the list of relations.
+ ///
+ [XmlElement("relation")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseGroupList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseGroupList.cs
new file mode 100644
index 000000000..b436cf3c6
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseGroupList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("recording-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class ReleaseGroupList : BaseList
+ {
+ ///
+ /// Gets or sets the list of release-groups.
+ ///
+ [XmlElement("release-group")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseList.cs
new file mode 100644
index 000000000..d8baa7514
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/ReleaseList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("release-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class ReleaseList : BaseList
+ {
+ ///
+ /// Gets or sets the list of releases.
+ ///
+ [XmlElement("release")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/TagList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/TagList.cs
new file mode 100644
index 000000000..759df8693
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/TagList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("tag-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class TagList : BaseList
+ {
+ ///
+ /// Gets or sets the list of tags.
+ ///
+ [XmlElement("tag")]
+ public List Items { get; set; }
+ }
+}
diff --git a/src/Hqub.MusicBrainz.API/Entities/Collections/TrackList.cs b/src/Hqub.MusicBrainz.API/Entities/Collections/TrackList.cs
new file mode 100644
index 000000000..49db502fc
--- /dev/null
+++ b/src/Hqub.MusicBrainz.API/Entities/Collections/TrackList.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Hqub.MusicBrainz.API.Entities.Collections
+{
+ [XmlRoot("track-list", Namespace = "http://musicbrainz.org/ns/mmd-2.0#")]
+ public class TrackList : BaseList
+ {
+ ///
+ /// Gets or sets the list of tracks.
+ ///
+ [XmlElement("track")]
+ public List