Quantcast
Channel: Azure Mobile Apps forum
Viewing all articles
Browse latest Browse all 3756

Joining tables, nested objects, Xamarin.Android

$
0
0

Deserialization fails when I try to join tables with many-to-many-relationship.

public class Player    {        ..        public int Id { getset; }        public string PlayerId { getset; }        public string PIN { getset; }        public DateTime? Created { getset; }        public string DeviceId { getset; }    }

public class GameMaster    {

public int Id { getset; }        publicstring GameMasterId { getset; }        publicstring Nick { getset; } ..    }

public class GameMasterInPlayer : Player    {        public GameMaster MainGameMaster { getset; }    }

I do a read on a relationship table and it returns the following:

[{"id":6,"PlayerId":"34f811b3-c06a-4ad2-83cf-cb91661f9a11","PIN":"","Created":"2013-11-18T18:44:07.915Z","DeviceId":"b7b1ce7a-09a7-4713-9c8e-db945ec20f42","MainGameMaster":{"id":1,"Nick":"Nils","GameMasterId":"ef3e176e-228f-450e-98d1-1bdd91f37412"}}]

JsonExtention.GetPropertyValues builds a KeyValuePair for each property until it reaches MainGameMaster. This is a JsonObject type and

JsonValue val = value.GetNamedValue(key) gives an exception. Do I have to implement a converter for a) the whole class or b) the GameMaster-property?

An attempt at implementing DataMemberJsonConverter did not fire. Am I supposed to implement ICustomMobileServiceTableSerialization? I want to keep my model-classes in a PCL.

Sincerely,

Eivind


eivholt


Viewing all articles
Browse latest Browse all 3756

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>