Start a new topic

Complex Entity Xamarin Datastore

Hi,

We have a complex field in one of our databases, we don't have a need to model this in our xamarin forms project. However the issue is without modelling it in the entity class it fails to decode any of the entities in this datastore. e.g a datastore fetch returns 0.

  

public class myEntity : Entity
    {
        [JsonProperty("FieldA")]
        public string FieldB{ get; set; }
        [JsonProperty("FieldB")]
        public string FieldB{ get; set; } // This is the complex object with multiple nested fields
    }

  Is there any way to convert/typecast the complex field to a plain string so that the entire field does not need to be modelled?

1 Comment

Hi Michael,

Could you please try following way for complex objects. Let us know if it doesn't work.
  

        [JsonObject("Date")]
        public class Date
        {
            [JsonProperty]
            public string Day { get; set; }

            [JsonProperty]
            public string Month { get; set; }

            [JsonProperty]
            public string Year { get; set; }

        } 

  

Regards,
Abhijeet


Login or Signup to post a comment