remove xml attributes from reviews
This commit is contained in:
@@ -26,17 +26,18 @@ namespace OnePeek.Api
|
|||||||
|
|
||||||
IEnumerable<XElement> xel = XDocument.Parse(xml).Elements().First().Descendants();
|
IEnumerable<XElement> xel = XDocument.Parse(xml).Elements().First().Descendants();
|
||||||
|
|
||||||
AppReviews result = Deserialize.Xml<AppReviews>(xml);
|
AppReviews result = new AppReviews();
|
||||||
result.Id = appId;
|
result.Id = appId;
|
||||||
result.StoreType = store;
|
result.StoreType = store;
|
||||||
result.StoreCultureType = storeCulture;
|
result.StoreCultureType = storeCulture;
|
||||||
result.Sorting = sorting;
|
result.Sorting = sorting;
|
||||||
|
result.StoreDataModifiedDate = DateTime.Parse(xel.Get("updated"));
|
||||||
|
|
||||||
// parse markers
|
// parse markers
|
||||||
result.PrevPageMarkerId = Utils.GetQueryPart(xel.FirstOrDefault(x => x.Name.LocalName == "link" && x.Attribute("rel").Value == "prev"), "href", "beforeMarker");
|
result.PrevPageMarkerId = Utils.GetQueryPart(xel.FirstOrDefault(x => x.Name.LocalName == "link" && x.Attribute("rel").Value == "prev"), "href", "beforeMarker");
|
||||||
result.NextPageMarkerId = Utils.GetQueryPart(xel.FirstOrDefault(x => x.Name.LocalName == "link" && x.Attribute("rel").Value == "next"), "href", "afterMarker");
|
result.NextPageMarkerId = Utils.GetQueryPart(xel.FirstOrDefault(x => x.Name.LocalName == "link" && x.Attribute("rel").Value == "next"), "href", "afterMarker");
|
||||||
|
|
||||||
// create images
|
// append reviews
|
||||||
result.Reviews = xel.Where(x => x.Name.LocalName == "entry").Select(x =>
|
result.Reviews = xel.Where(x => x.Name.LocalName == "entry").Select(x =>
|
||||||
{
|
{
|
||||||
IEnumerable<XElement> childs = x.Descendants();
|
IEnumerable<XElement> childs = x.Descendants();
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
<Compile Include="ApiHttpClient.cs" />
|
<Compile Include="ApiHttpClient.cs" />
|
||||||
<Compile Include="AppMetadataEndpoint.cs" />
|
<Compile Include="AppMetadataEndpoint.cs" />
|
||||||
<Compile Include="AppRatingEndpoint.cs" />
|
<Compile Include="AppRatingEndpoint.cs" />
|
||||||
|
<Compile Include="Configuration.cs" />
|
||||||
<Compile Include="EndpointUris.cs" />
|
<Compile Include="EndpointUris.cs" />
|
||||||
<Compile Include="Extensions\EntityExtensions.cs" />
|
<Compile Include="Extensions\EntityExtensions.cs" />
|
||||||
<Compile Include="Extensions\EnumExtensions.cs" />
|
<Compile Include="Extensions\EnumExtensions.cs" />
|
||||||
|
|||||||
@@ -4,12 +4,10 @@ using System.Xml.Serialization;
|
|||||||
|
|
||||||
namespace OnePeek.Entities
|
namespace OnePeek.Entities
|
||||||
{
|
{
|
||||||
[XmlRoot("feed")]
|
|
||||||
public partial class AppReviews
|
public partial class AppReviews
|
||||||
{
|
{
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
[XmlElement("updated")]
|
|
||||||
public DateTime? StoreDataModifiedDate { get; set; }
|
public DateTime? StoreDataModifiedDate { get; set; }
|
||||||
|
|
||||||
public StoreType StoreType { get; set; }
|
public StoreType StoreType { get; set; }
|
||||||
@@ -26,28 +24,20 @@ namespace OnePeek.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[XmlRoot("entry")]
|
|
||||||
public partial class AppReview
|
public partial class AppReview
|
||||||
{
|
{
|
||||||
[XmlElement("reviewId")]
|
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
[XmlElement("updated")]
|
|
||||||
public DateTime CreatedDate { get; set; }
|
public DateTime CreatedDate { get; set; }
|
||||||
|
|
||||||
[XmlElement("name")]
|
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
|
|
||||||
[XmlElement("content")]
|
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
|
|
||||||
[XmlElement("userRating")]
|
|
||||||
public byte Rating { get; set; }
|
public byte Rating { get; set; }
|
||||||
|
|
||||||
[XmlElement("device")]
|
|
||||||
public string Device { get; set; }
|
public string Device { get; set; }
|
||||||
|
|
||||||
[XmlElement("productVersion")]
|
|
||||||
public string AppVersion { get; set; }
|
public string AppVersion { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user