Hello, I'm doing an integration with the Tray Comerce API and thought about generating a generic class with the list answer . In all listings, the API implements the following return class:
public class Response<T>
{
[JsonProperty("paging")]
public ResponsePaging Paging { get; set; }
[JsonProperty("sort")]
public Dictionary<string, string> Sort { get; set; }
[JsonProperty("availableFilters")]
public List<string> AvailableFilters { get; set; }
[JsonProperty("appliedFilters")]
public List<string> AppliedFilters { get; set; }
[JsonProperty(????)]
public List<T> List { get; set; }
public class ResponsePaging
{
public int total { get; set; }
public int page { get; set; }
public int offset { get; set; }
public int limit { get; set; }
public int maxLimit { get; set; }
}
}
The problem is that for each API route that makes a listing, the result of this listing is set to a different name (ex in% with_column returns Orders , in {web_api}/orders
returns Products , etc ...)
How do I pass as a parameter to the class what will be the name of the property that will be assigned to {web_api}/products
of property [JsonProperty(????)]
?