Deserialization fails when I try to join tables with many-to-many-relationship.
public class Player { .. public int Id { get; set; } public string PlayerId { get; set; } public string PIN { get; set; } public DateTime? Created { get; set; } public string DeviceId { get; set; } }
public class GameMaster {
public int Id { get; set; } publicstring GameMasterId { get; set; } publicstring Nick { get; set; } .. }
public class GameMasterInPlayer : Player { public GameMaster MainGameMaster { get; set; } }
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