I am using the C# Api_ng_sample_code project as the basis to work from and build my own code.
However I noticed that the MarketProjection definition didn't contain the RUNNER_METADATA parameter in it, so I added it e.g
Now when I call
I don't get anything else in my results from this call apart from the usual e.g no runner meta info (silks etc)
This is most certainly because the marketCatalouges definition doesn't provide any way for the runner metadata to be returned. The problem is I don't know HOW it is supposed to be formatted to add it in to the code.
The current definition for marketCatalouges is:
I have tried playing around with the Runners loop as I guess that is where the meta data will come from but I have had no luck getting anything to output.
How am I supposed to reformat this method to return the meta data I need for silks and other runner meta information etc?
Any help would be much appreciated. I really don't want to have to keep relying on screen scraping for this info!
Thanks
However I noticed that the MarketProjection definition didn't contain the RUNNER_METADATA parameter in it, so I added it e.g
Code:
[JsonConverter(typeof(StringEnumConverter))]
public enum MarketProjection
{
COMPETITION, EVENT, EVENT_TYPE, MARKET_DESCRIPTION, RUNNER_DESCRIPTION, MARKET_START_TIME, [B]RUNNER_METADATA[/B]
}
Code:
ISet<MarketProjection> marketProjections = new HashSet<MarketProjection>(); marketProjections.Add(MarketProjection.COMPETITION); marketProjections.Add(MarketProjection.RUNNER_DESCRIPTION); marketProjections.Add(MarketProjection.COMPETITION); marketProjections.Add(MarketProjection.EVENT); marketProjections.Add(MarketProjection.EVENT_TYPE); marketProjections.Add(MarketProjection.MARKET_START_TIME); marketProjections.Add(MarketProjection.RUNNER_METADATA);
Code:
var marketCatalogues = client.listMarketCatalogue(marketFilter, marketProjections, marketSort, maxResults);
This is most certainly because the marketCatalouges definition doesn't provide any way for the runner metadata to be returned. The problem is I don't know HOW it is supposed to be formatted to add it in to the code.
The current definition for marketCatalouges is:
Code:
public class MarketCatalogue
{
[JsonProperty(PropertyName = "marketId")]
public string MarketId { get; set; }
[JsonProperty(PropertyName = "marketStartTime")]
public string MarketStartTime { get; set; }
[JsonProperty(PropertyName = "marketName")]
public string MarketName { get; set; }
[JsonProperty(PropertyName = "isMarketDataDelayed")]
public bool IsMarketDataDelayed { get; set; }
[JsonProperty(PropertyName = "description")]
public MarketDescription Description { get; set; }
[JsonProperty(PropertyName = "runners")]
public List<RunnerDescription> Runners { get; set; }
[JsonProperty(PropertyName = "eventType")]
public EventType EventType { get; set; }
[JsonProperty(PropertyName = "event")]
public Event Event { get; set; }
[JsonProperty(PropertyName = "competition")]
public Competition Competition { get; set; }
public override string ToString()
{
// well, don't bother displaying event/event type/competition
var sb = new StringBuilder().AppendFormat("{0}", "MarketCatalogue")
.AppendFormat(" : Market={0}[{1}]", MarketId, MarketName)
.AppendFormat(" : IsMarketDataDelayed={0}", IsMarketDataDelayed);
if (Description != null)
{
sb.AppendFormat(" : {0}", Description);
}
if (EventType != null)
{
sb.AppendFormat(" : {0}", EventType);
}
if (Event != null)
{
sb.AppendFormat(" : {0}", Event);
}
if (Competition != null)
{
sb.AppendFormat(" : {0}", Competition);
}
if (Runners != null && Runners.Count > 0)
{
int idx = 0;
foreach (var runner in Runners)
{
sb.AppendFormat(" : Runner[{0}]={1}", idx++, runner);
}
}
return sb.ToString();
}
}
I have tried playing around with the Runners loop as I guess that is where the meta data will come from but I have had no luck getting anything to output.
How am I supposed to reformat this method to return the meta data I need for silks and other runner meta information etc?
Any help would be much appreciated. I really don't want to have to keep relying on screen scraping for this info!
Thanks


Comment