|
|
DB.Select() wouldn't allow you to compare the value of one column of a
record to another column in that record. What this patch allows you to do
is something like:
DB.Select().From<PromotionCode>()
.Where(PromotionCode.TotalUsedColumn).IsLessThan(PromotionCode.LimitColumn)
Normally, the IsLessThan method (and other comparison methods) just
compares the value you send in to it, but this patch checks if the value
passed in is of type TableSchema.TableColumn and if it is, it then writes
the column name to the generated SQL instead of the value passed in. The
patch should work for all comparison methods except Is, IsNot, In, NotIn,
and BetweenAnd.
Patch attached.
|
ColumnToColumnComparison.patch
1.4 KB
Download
|
|