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
The following exception happens when having a boolean constant in the index query. It was tested with release (3.3.0) connecting to SQL Server (this issue might be related to #476 )
Message:
Microsoft.Data.SqlClient.SqlException : An expression of non-boolean type specified in a context where a condition is expected, near 'or'.
Stack Trace:
I have created the following test to reproduce the issue:
[Fact]
public async Task ShouldHandleBooleanConstants()
{
_store.RegisterIndexes<PersonWithAIndexProvider>();
using (var session = _store.CreateSession())
{
session.Save(new Person { Firstname = "Alex" });
session.Save(new Person { Firstname = "Bill" });
session.Save(new Person { Firstname = "assan" });
await session.SaveChangesAsync();
}
using (var session = _store.CreateSession())
{
string firstName = null;
Assert.Null(await session.QueryIndex<PersonByBothNamesCol>(x =>
firstName == null ||
firstName == x.Firstname
).FirstOrDefaultAsync());
}
}
I believe it is specific to SQL Server due to the fact that Boolean parameters needs an equal (=) operator to be interpreted correctly.
The text was updated successfully, but these errors were encountered:
The following exception happens when having a boolean constant in the index query. It was tested with release (3.3.0) connecting to SQL Server (this issue might be related to #476 )
I have created the following test to reproduce the issue:
I believe it is specific to SQL Server due to the fact that Boolean parameters needs an equal (=) operator to be interpreted correctly.
The text was updated successfully, but these errors were encountered: