- changed status to resolved
Unable to create tables with relationships
Issue #13
resolved
I'm working on a Windows Phone 8.1 (WinRT) project, and can't get relationships to work. I'm using the SQLite-Net package with this SQLite-Net Extensions.
When I use the following code, it gives me an error telling me that SQLite doesn't know what an Album is.
using (var db = new SQLite.SQLiteConnection(DBPath))
{
// Create the tables if they don't exist
db.CreateTable<Track>();
db.CreateTable<Album>();
db.CreateTable<Contributor>();
db.CreateTable<Artist>();
}
It happens because the Track object has an Album object in it, with the relationship set to ManyToOne.
Track.cs:
public class Track
{
[. . . some other properties . . .]
[ManyToOne]
public Album Album { get; set; }
}
Any idea what's going on?
(I apologize if creating an issue here isn't the best way to ask this)
Comments (1)
-
reporter - Log in to comment
Nevermind. I was too ADD to actually completely read the documentation where it specifically says which SQLite libraries it works with. I ended up using SQLite.Net PCL