I have the following class:
Class1.cs:
[JsonObject(MemberSerialization.OptIn)]
public class Class1
{
[PrimaryKey]
[JsonProperty("key1")]
public string Key1 { get; set; }
[PrimaryKey]
[JsonProperty("key2")]
public string Key2 { get; set; }
[PrimaryKey]
[JsonProperty("key3")]
public string Key3 { get; set; }
[JsonProperty("normalStuff")]
public string NormalStuff{ get; set; }
[OneToMany(CascadeOperations = CascadeOperation.All)]
[JsonProperty("customObjectList")]
public List<CustomObject> CustomObjects { get; set; }
}
And then my CustomObject class:
[JsonObject(MemberSerialization.OptIn)]
public class CustomObject
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[ForeignKey(typeof(Class1))]
public string Class1Key{ get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("value")]
public string Value { get; set; }
}
Basically what I'm trying to accomplish is have a table that contains mappings to these custom objects. Is this even supported in SQLite-Net extensions? The composite keys aspect is supported in the newest version of the MVVMCross SQLite community package. When I try to save the above data structure to my DB it saves everything except for my CustomObjects... those end up being null. Let me know if you need any more information to understand what I'm trying to accomplish!