C# + sqlite-net - querying bool column always returns false
I'm using SQLite in my project and to connect to DB I use sqlite-net
library. I have created a model:
internal class Product
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
...
public bool IsDefault { get; set; }
}
There are a few records in database - some have IsDefault column value set
to true, some to false. However, when I try to query records like this:
var result = dc.Table<Product>().ToArray();
every record has IsDefault set to false. Inserting a record works fine,
but querying it do not.
I tried to change type of column to Int in the model - in this case it
always return 0.
No comments:
Post a Comment