The following query is not working as expected:
var response = db.LoadSelect(db.From<Activity>()
.Where(x => x.AccountID == request.AccountID)
.And(x => x.Active == true || request.IncludeInactive)
.And(x => x.Deleted == true || request.IncludeDeleted)
.OrderByDescending(x => x.DateCreated)
.Limit(0, 50));
produces the following LastCommandText:
"SELECT `ID`...... `AccountID` // All fields here...
FROM `Activity`
WHERE (((`AccountID` = @0) AND ((`Active` = @1) OR (1=0))) AND ((`Deleted` = @2) OR (1=0)))
ORDER BY `DateCreated` DESC
LIMIT 50 OFFSET 0"
This returns no results, however if i substitute the @ params with correct values the query is correct
Am I doing something wrong here?