lundi 22 février 2016

SQLite Foreign keys in windows phone C#

I'm using SQLite on WindowsPhone 8.1 and I'm using sqlite-net(nuget package) wrapper.

public class Subject
{
    [SQLite.PrimaryKey,SQLite.AutoIncrement]
    public int SubId { get; set; }

    public int ClassId { get; set; }

    public string Name { get; set; }
}

I want ClassId to be a foreign key. But I'm unable to specify it. The SQLite.ForeignKey option is not available. How can i actually specify a FK here. I'm using MVVM pattern and I'm using

            using (App.dbConn = new SQLiteConnection(App.DB_PATH))
            {
                dbConn.CreateTable<Subject>();
            }

to create table.

Aucun commentaire:

Enregistrer un commentaire