You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class FocusSelection
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
// some properties
}
I add a record into that table. It is there. Everything is fine. Now to implement a new feature I add the SomeProperty below.
Then update the app version and run it.
public class FocusSelection
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
// some properties
public bool SomeProperty { get; set; }
}
At the very start of the app I execute the code.
await _databaseService.Connection.RunInTransactionAsync(connection =>
{
// this returns that record with SomeProperty = false as expected
var all = connection.Table<Models.Database.FocusSelection>().ToList();
// But this returns 0 records
var t = connection.Table<Models.Database.FocusSelection>().Where(x => !x.SomeProperty).ToList();
}
And the only way to make query work is to do this
await _databaseService.Connection.RunInTransactionAsync(connection =>
{
var all = connection.Table<Models.Database.FocusSelection>().ToList();
// updating records
all.ForEach(x => connection.Update(x));
// Now this query works fine
var t = connection.Table<Models.Database.FocusSelection>().Where(x => !x.SomeProperty).ToList();
}
The text was updated successfully, but these errors were encountered:
VNGames
changed the title
Where clause doesn't work with bool when record is migrated until the record is updated
"Where" clause doesn't work with bool when record is migrated until the record is updated
Jul 21, 2024
I have a table
I add a record into that table. It is there. Everything is fine. Now to implement a new feature I add the SomeProperty below.
Then update the app version and run it.
At the very start of the app I execute the code.
And the only way to make query work is to do this
The text was updated successfully, but these errors were encountered: