Skip to content

Commit 514cd2c

Browse files
committed
Better approach is to use lowercase on WhereDatePart method
1 parent a45a51f commit 514cd2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

QueryBuilder/Base.Where.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public Q WhereDatePart(string part, string column, string op, object value)
581581
Operator = op,
582582
Column = column,
583583
Value = value,
584-
Part = part,
584+
Part = part?.ToLowerInvariant(),
585585
IsOr = GetOr(),
586586
IsNot = GetNot(),
587587
});

QueryBuilder/Compilers/OracleCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected override string CompileBasicDateCondition(SqlResult ctx, BasicDateCond
108108

109109
var isDateTime = (condition.Value is DateTime dt);
110110

111-
switch (condition.Part?.ToLowerInvariant())
111+
switch (condition.Part)
112112
{
113113
case "date": // assume YY-MM-DD format
114114
if (isDateTime)

0 commit comments

Comments
 (0)