When i create a model from a table in SQLite which contains boolean columns, the resulting property is created as System.Object instead of System.Boolean.
Running a LINQ query on this table generates the following sql
SELECT t1.Author AS Author, t1.Category AS Category, t1.IsPublished AS IsPublish
ed, t1.DatePublished AS DatePublished, t1.Title AS Title, t1.Content AS Content,
t1.ID AS ID
FROM BlogEntries t1
WHERE t1.IsPublished = :p0
-- p0: Input Int32 (Size = 0; DbType = Int32) [True]
-- Context: Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider Model: ao Build:
2.20.11.0
and consequently, nothing is matched irrespective if i put in true or false
This is the code snippet I am using
Data.DataContext dx = new Data.DataContext();
dx.Log = Console.Out;
var r = (from d in dx.Blogentries
where d.Ispublished.Equals(true)
select d);
foreach (var d1 in r)
{
Console.WriteLine(d1.Title);
Console.WriteLine(d1.Ispublished);
}
Problem with boolean columns
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
I will send you a test project in a letter, please check that it was not blocked by your mail filter. We couldn't reproduce the problem with incorrect query results, please specify what should be changed in the sample for this.
However, we've set mapping to System.Boolean for SQLite columns declared as 'boolean'. These changes will be available in the nearest build.
At the moment, the 'bit' and 'bool' columns are mapped to System.Boolean by default. Also, you can change the .NET data type manually; to do so, please double-click the corresponding entity property and select System.Boolean from the 'Type' drop-down list.
However, we've set mapping to System.Boolean for SQLite columns declared as 'boolean'. These changes will be available in the nearest build.
At the moment, the 'bit' and 'bool' columns are mapped to System.Boolean by default. Also, you can change the .NET data type manually; to do so, please double-click the corresponding entity property and select System.Boolean from the 'Type' drop-down list.