Skip to content

Commit

Permalink
Fixed translation of SQL expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
glecchi committed Nov 21, 2024
1 parent 5bf97f0 commit 8607d48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Lib/CSQLQueryExpress/CSQLQueryExpress.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Title>CSQLQueryExpress</Title>
<Version>1.4.4</Version>
<Version>1.4.5</Version>
<Description>A simple c# library to compile TSQL queries</Description>
<PackageProjectUrl></PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
10 changes: 8 additions & 2 deletions Lib/CSQLQueryExpress/Compiler/SQLQueryTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ public string GetTableName(Type tableType)

public string GetColumnsWithoutTableAlias(string column)
{
var tableAlias = _matchColumnOnly.Match(column).Groups[0].Value;
return column.Replace(tableAlias, string.Empty);
var match = _matchColumnOnly.Match(column);
if (match.Success)
{
var tableAlias = match.Groups[0].Value;
return column.Replace(tableAlias, string.Empty);
}

return column;
}

private bool _memberExpressionFromBinaryExpression;
Expand Down

0 comments on commit 8607d48

Please sign in to comment.