I am using sqlite-net for sqlite in my windows phone universal application I have following class with table and column attributes and using async connection to add data in sqlite all is working fine, But the Id column is not auto incremented neither it is a primary key. Does any one else face this issue? following is my code.
[Table("Account")] public class Account { [PrimaryKey, AutoIncrement] [Column("Id")] public int Id { get; set; } [Column("FirstName")] public string FirstName { get; set; } [Column("LastName")] public string LastName { get; set; } [Ignore] public string FullName { get; set; } } SQLite.SQLiteAsyncConnection conn = new SQLite.SQLiteAsyncConnection("database.sqlite"); var result = await conn.CreateTableAsync<Account>(); var _accountList = new Account(); _accountList.FirstName = "Name 1"; _accountList.LastName = "------------"; var result1 = await conn.InsertAsync(_accountList); _accountList = new Account(); _accountList.FirstName = "Name 2"; _accountList.LastName = "------------"; result1 = await conn.InsertAsync(_accountList); var list = await conn.Table<Account>().ToListAsync(); var item = list; on reading the table Id is always 0 for all records. Is there any way to fix this?