No announcement yet.

clothNumber from metadata

  • Filter
  • Time
  • Show
Clear All
new posts

  • clothNumber from metadata

    Can anyone enlighten me on getting the clothNumbers in a Datarid along with existing horses name etc.
    I can get the metadata including clothNumber in a TextBox but thats before serialising . Im using the programming for Betfair
    in windowsFormsApp(.NETFRAMEWORK)

    Be much appreciated.


  • #2
    I'm not certain what the problem is, but I think I can see it, but please tell me if I'm wrong.

    Within the RunnerCatalog for each horse, in the MarketCatalogue data, is this:
    metadata Map<String,String>
    And I don't know what Map<String,String> means.

    At the moment, my VS Studio userid brings up objections when I try to open it because it says my userid has expired. I need to sort this out, but I don't have the time for such messing about right now.

    I'm assuming that deserialising the data returned from a ListMarketCatalogue call does not put data nicely into the RunnerCatalog.metadata data items.

    At present I can't easily retrieve any metadata to look at. It it possible that you could get hold of the metadata for a horse and then paste it in the thread so I can try to work out how you can easliy get the item that you are after? Cheers.


    After further thoughts, I checked the offline API PDF and found two other instances of the use of Map<string, string>. It appears that the data is designed to be loaded into a .NET list item so that all items can be directly referenced, using the data item name as key, if I've understood it correctly.

    This would means you should define the Metadata as a keyed list. It's been a while since I've done this, and with VS Studio currently being difficult, I can't locate an example for you.
    Last edited by jabe; 09-04-2021, 02:10 PM.


    • #3
      Metadata in terms of .NET Framework is a dictionary <string, string>.
      Here is my definintion of metadata field in the RunnerCatalog class:
      Public metadata As Dictionary(Of String, String)

      Example how to get the clothNumber from metadata:

      Dim clothNumber As String = Nothing
      If runner.metadata.TryGetValue("CLOTH_NUMBER_ALPHA", clothNumber) Then
      End If