Serializing Azure Mobile Services objects

I am trying to serialize an object in Azure Mobile Services.

The object contains an array of the second object, which must also be serialized.

[DataContract()] class ObjectA { [DataMember(Name= "id")] public int Id { get; set; } [DataMember(Name = "info")] public string info{ get; set; } [DataMember(Name = "collectionOfB")] public ObjectB[] myArrayOfB{ get; set; } } [DataContract()] class ObjectB { [DataMember(Name= "id")] public int Id { get; set; } [DataMember(Name = "info")] public string info{ get; set; } } 

I loaded both tables correctly and can insert a separate item into each of the tables.

However, when I call the InsertAsync method in the table for objectA, I get an error

 Cannot serialize member 'myArrayOfB' of type 'namespace.ObjectB[]' declared on type 'ObjectA' 

Any idea on what I need to do to fix this?

+4
source share

Source: https://habr.com/ru/post/1445328/


All Articles