Is there a way to have a collection of different class types which inherit from the same parent class in SQLite.Net Extensions? Ideally I would like to have an array of objects which conform to an interface or abstract class, however I can't even get child types of standard classes to work.
public class ActivityCategory
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Title { get; set; }
public string Icon { get; set; }
public bool Recommended { get; set; }
[OneToMany(CascadeOperations = CascadeOperation.All)]
public SomeAbstractClass[] multipleTypesAllowed { get; set; }
}
public abstract class SomeAbstractClass
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string SomeValue { get; set; }
[ForeignKey(typeof(ActivityCategory))]
public int ActivityCategoryId { get; set; }
[ManyToOne(CascadeOperations = CascadeOperation.All)]
public ActivityCategory Category { get; set; }
}
I can't get the above to return anything other than an empty array for the multipleTypesAllowed. It works if I make the parent class not abstract and instantiate it, but even child classes of that don't work. Is there any way to have inheritance work with SQLite.Net?
Cheers.