Hi,
SQL Server, LLBLGen v.5.7.x
var qf = new QueryFactory();
var q = qf.Create()
.Select
(
qf.XXX
.Select(XXX.Id)
.Where(XXX.JobId == Guid.NewGuid())
.Any()
);
var exists = this.AdapterToUse.FetchScalar<bool>(q);
noticed that this query works fine even though it doesn't match any records but when the target table has data and fails when there's no data with "The database returned a NULL value however the type specified ('System.Boolean') isn't a nullable type". Can't say how .Any() was envisioned to work, but the solution is to use a nullable, i.e. .FetchScalar<bool?>(q)
Docs seem to suggest that too, though there ??
is applied to a non-nullable values. Probably this needs to be corrected 
Thank you!