Hi,
Using SQL Server 2005 I have a table that contains a bit field. When the table is viewed, the console automatically translates this to true/false.
So I'm trying to query this with nHibernate to match all records for which this field is "true", like this:
Dim results As ArrayList = session.CreateCriteria(Of DataTransferObjects.Product) _
.CreateAlias("Skus", "sku") _
.Add(Expression.Eq("sku.IsUnlimitedStock", True)) _
.List()
Which throws the error Type mismatch in NHibernate.Criterion.SimpleExpression: sku.IsUnlimitedStock expected type System.Boolean, actual type System.String
Now I've tried various things here: replacing the True statement with 0, "True" and ensuring that True is actually a boolean by casting it, but I always get the same error.
What value is nHibernate expecting?