Skip to content
Permalink
Browse files

- 兼容 Vb.Net 无法使用 int? 类型 = 等号表达式解析;#140

  • Loading branch information
28810 28810
28810 authored and 28810 committed Dec 21, 2019
1 parent 1b1f5c1 commit 43301481938dc775f782a0fc089b9651c1ea9f03
Showing with 6 additions and 0 deletions.
  1. +5 −0 FreeSql.Tests.VB/UnitTest1.vb
  2. +1 −0 FreeSql/Internal/CommonExpression.cs
@@ -10,6 +10,10 @@ Namespace FreeSql.Tests.VB
Dim id As Integer = 100
Dim List1 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.Id = 100).ToList()
Dim List2 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.Id = id).ToList()
Dim List11 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.IdNullable = 100).ToList()
Dim List22 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.IdNullable = id).ToList()
Dim idNullable As Integer? = 100
Dim List222 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.IdNullable = idNullable).ToList()
Dim List3 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.Title = "xxx").ToList()
Dim title As String = "xxx"
Dim List4 = g.sqlserver.Select(Of Testvb).Where(Function(a) a.Title = title).ToList()
@@ -43,6 +47,7 @@ Class Testvb
Property Id As Integer
Property Title As String
Property IsDeleted As Boolean
Property IdNullable As Integer?

Property Testvb2s As List(Of Testvb2)
End Class
@@ -559,6 +559,7 @@ public string ExpressionLambdaToSql(Expression exp, ExpTSC tsc)
case ExpressionType.Lambda: return ExpressionLambdaToSql((exp as LambdaExpression)?.Body, tsc);
case ExpressionType.TypeAs:
case ExpressionType.Convert:
case ExpressionType.ConvertChecked:
//var othercExp = ExpressionLambdaToSqlOther(exp, tsc);
//if (string.IsNullOrEmpty(othercExp) == false) return othercExp;
return ExpressionLambdaToSql((exp as UnaryExpression)?.Operand, tsc);

0 comments on commit 4330148

Please sign in to comment.
You can’t perform that action at this time.