Skip to content

Commit 8607d48

Browse files
committed
Fixed translation of SQL expressions.
1 parent 5bf97f0 commit 8607d48

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Lib/CSQLQueryExpress/CSQLQueryExpress.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<Title>CSQLQueryExpress</Title>
6-
<Version>1.4.4</Version>
6+
<Version>1.4.5</Version>
77
<Description>A simple c# library to compile TSQL queries</Description>
88
<PackageProjectUrl></PackageProjectUrl>
99
<PackageReadmeFile>README.md</PackageReadmeFile>

Lib/CSQLQueryExpress/Compiler/SQLQueryTranslator.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@ public string GetTableName(Type tableType)
6363

6464
public string GetColumnsWithoutTableAlias(string column)
6565
{
66-
var tableAlias = _matchColumnOnly.Match(column).Groups[0].Value;
67-
return column.Replace(tableAlias, string.Empty);
66+
var match = _matchColumnOnly.Match(column);
67+
if (match.Success)
68+
{
69+
var tableAlias = match.Groups[0].Value;
70+
return column.Replace(tableAlias, string.Empty);
71+
}
72+
73+
return column;
6874
}
6975

7076
private bool _memberExpressionFromBinaryExpression;

0 commit comments

Comments
 (0)