I install SQLiteNetExtensions from nuget using Visual Studio 2015 in a UWP project. This is my model:
public class MovieItem
{
[PrimaryKey]
public string Url { get; set; }
[OneToMany(CascadeOperations = CascadeOperation.All)]
public List<EpisodeItem> Episodes { get; private set; }
}
public class EpisodeItem
{
private bool _selected;
[PrimaryKey]
public string Url { get; internal set; }
[ForeignKey(typeof(MovieItem))]
public string MovieUrl { get; set; }
[ManyToOne]
public MovieItem Movie { get; set; }
}
But when I run:
var movieItem = new MovieItem{
Url='movie link',
Episodes = new List<Episode>{
Url='episode link'
}
};
conn.InsertWithChildren(movieItem,true);
And open database file with SqliteBrowser. I get only MovieItem record without any Episode record. I have tried many ways but it still does not work.