- 优化 GlobalFilter Apply 自动重命名表达式参数名,避免内容重复问题;

- 修复 表达式解析 Guid.NewGuid() 的错误;
This commit is contained in:
28810
2019-12-05 20:10:39 +08:00
parent e01f7a2061
commit 05cf13f560
14 changed files with 90 additions and 109 deletions

View File

@ -70,21 +70,21 @@ namespace FreeSql.MySql
case "System.UInt64": return $"cast({getExp(callExp.Arguments[0])} as unsigned)";
case "System.Guid": return $"substr(cast({getExp(callExp.Arguments[0])} as char), 1, 36)";
}
break;
return null;
case "NewGuid":
break;
return null;
case "Next":
if (callExp.Object?.Type == typeof(Random)) return "cast(rand()*1000000000 as signed)";
break;
return null;
case "NextDouble":
if (callExp.Object?.Type == typeof(Random)) return "rand()";
break;
return null;
case "Random":
if (callExp.Method.DeclaringType.IsNumberType()) return "rand()";
break;
return null;
case "ToString":
if (callExp.Object != null) return callExp.Arguments.Count == 0 ? $"cast({getExp(callExp.Object)} as char)" : null;
break;
return null;
}
var objExp = callExp.Object;