FROM "Tasks" LEFT JOIN "Tasks" history ON (("history"."Id" = "history"."ParentId") AND (("history"."CreatedAt" >= '20160928 00:00:00.000') OR ("history"."CreatedAt" >= '20160928 00:00:00.000')))
Unfortunately OrmLite’s Typed APIs doesn’t support self joins as the Table name the Join Alias replaces is the same. You’d need to drop down to custom SQL for Self Join conditions, e.g:
var q = db.From<Task>()
.CustomJoin("LEFT JOIN Task history ON (Task.Id = history.ParentId)")
.Where("history.\"Created\" >= {0} OR Task.\"Created\" >= {0}", viewmodel.CreatedAtFromDateTime);