Skip to content

Commit

Permalink
Fix double validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Mar 21, 2024
1 parent 4bfd6ae commit 46910c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ private static void AppendField(StringBuilder builder, EntityFieldInfo field, st
return;

if (field.IsNumber || field.IsBoolean || field.IsMoney)
{
builder.Append(term);
}
else if (field is { IsDate: true })
{
term = term.Trim();
Expand Down
2 changes: 1 addition & 1 deletion src/Foundatio.Parsers.SqlQueries/SqlQueryParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<QueryValidationResult> ValidateAsync(string query, SqlQueryVis
public async Task<string> ToDynamicLinqAsync(string query, SqlQueryVisitorContext context)
{
var node = await ParseAsync(query, context);
var result = await ValidationVisitor.RunAsync(node, context);
var result = context.GetValidationResult();
if (!result.IsValid)
throw new ValidationException("Invalid query: " + result.Message);

Expand Down

0 comments on commit 46910c7

Please sign in to comment.