dimanche 8 mai 2016

SQLite Key Property Issue Using Mvvm Windows Universal

This is my Model called "ChallengeItem" for the SQLite table:

   [AutoIncrement]
    private int _key { get; set; }

    public int Key
    {
        get { return _key; }
        set { _key = value; OnPropertyChanged("Key");}
    }

    private bool _done;

    public bool Done
    {
        get { return _done; }
        set { _done = value; OnPropertyChanged("Done"); }
    }

I created a class called "DatabaseManager" which includes this line of Code:

  conn.CreateTable<Models.ChallengeItem>();

  • After checking the Key property it turns out that it doesn't increment, the key value is staying 0 for every Challengeitem in the table. How can I fix this?
  • How can I get the last Item in the table where the Done Property of the challengeitem equals true?

Aucun commentaire:

Enregistrer un commentaire