mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
update Exception message
This commit is contained in:
parent
98e9430db7
commit
e2d6c890a9
@ -1,4 +1,4 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using FreeSql.DataAnnotations;
|
||||
using FreeSql.Tests.DataContext.SqlServer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -1954,7 +1954,33 @@ namespace FreeSql.Internal
|
||||
return;
|
||||
}
|
||||
exp3tmp = exp3Stack.Pop();
|
||||
if (exp3tmp.NodeType != ExpressionType.Parameter) return;
|
||||
if (exp3tmp.NodeType != ExpressionType.Parameter)
|
||||
{
|
||||
//if (e.Expression.NodeType == ExpressionType.Call)
|
||||
//{
|
||||
// var rootExpCall = e.Expression as MethodCallExpression;
|
||||
// if (rootExpCall.Object == null && rootExpCall.Method.Name == "Any" &&
|
||||
// rootExpCall.Arguments.Count == 2 &&
|
||||
// rootExpCall.Arguments[0].Type.GetGenericTypeDefinition() == typeof(IEnumerable<>) &&
|
||||
// rootExpCall.Arguments[1].Type == typeof(Func<,>).MakeGenericType(rootExpCall.Arguments[0].Type.GetGenericArguments()[0], typeof(bool)))
|
||||
// {
|
||||
// //e.Tables[0].Parameter
|
||||
// var anyExp = rootExpCall.Arguments[1];
|
||||
// while(anyExp.NodeType == ExpressionType.AndAlso)
|
||||
// {
|
||||
|
||||
// }
|
||||
// if (anyExp.NodeType != ExpressionType.AndAlso && anyExp.NodeType != ExpressionType.Equal) return;
|
||||
|
||||
|
||||
// var array = Expression.Lambda(rootExpCall.Arguments[0]).Compile().DynamicInvoke() as IEnumerable;
|
||||
// foreach (var arritem in array)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
return;
|
||||
}
|
||||
if (exp3tmp.Type.FullName.StartsWith("FreeSql.ISelectGroupingAggregate")) return;
|
||||
var commonExp = sender as FreeSql.Internal.CommonExpression;
|
||||
if (commonExp == null) return;
|
||||
|
@ -1003,7 +1003,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
sb.Append(" \r\nWHERE ");
|
||||
if (_source.Any())
|
||||
{
|
||||
if (_tempPrimarys.Any() == false) throw new ArgumentException($"{_table.Type.DisplayCsharp()} 没有定义主键,无法使用 SetSource,请尝试 SetDto");
|
||||
if (_tempPrimarys.Any() == false) throw new ArgumentException($"{_table.Type.DisplayCsharp()} 没有定义主键,无法使用 SetSource,请尝试 SetDto 或者 SetSource 指定临时主键");
|
||||
sb.Append('(').Append(_commonUtils.WhereItems(_tempPrimarys, "", _source)).Append(')');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user