From 9308c132532491463503aefbe149ee8ed57ad8c2 Mon Sep 17 00:00:00 2001 From: Zachary Keeping Date: Wed, 11 Apr 2018 16:18:10 +1000 Subject: [PATCH] Add JsonProperty to each Page field Add JsonProperty to each Page field so serialisation will more closely match the API --- PexelsNet/Page.cs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/PexelsNet/Page.cs b/PexelsNet/Page.cs index fb4382f..ba9b9b8 100644 --- a/PexelsNet/Page.cs +++ b/PexelsNet/Page.cs @@ -1,27 +1,53 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Newtonsoft.Json; namespace PexelsNet { public class Source { + [JsonProperty("original")] public string Original { get; set; } + + [JsonProperty("large")] public string Large { get; set; } + + [JsonProperty("medium")] public string Medium { get; set; } + + [JsonProperty("small")] public string Small { get; set; } + + [JsonProperty("portrait")] public string Portrait { get; set; } + + [JsonProperty("square")] public string Square { get; set; } + + [JsonProperty("landscape")] public string Landscape { get; set; } + + [JsonProperty("tiny")] public string Tiny { get; set; } } public class Photo { + [JsonProperty("id")] public int Id { get; set; } + + [JsonProperty("width")] public int Width { get; set; } + + [JsonProperty("height")] public int Height { get; set; } + + [JsonProperty("url")] public string Url { get; set; } + + [JsonProperty("photographer")] public string Photographer { get; set; } + + [JsonProperty("src")] public Source Src { get; set; } } @@ -39,6 +65,7 @@ public class Page [JsonProperty("next_page")] public string NextPage { get; set; } + [JsonProperty("photos")] public List Photos { get; set; } } }