mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 优化 Include 友好错误提示;
This commit is contained in:
parent
a45cfff5f6
commit
34ba9fbf4f
@ -354,6 +354,8 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
var expBody = navigateSelector?.Body;
|
||||
if (expBody == null) return this;
|
||||
if (expBody.NodeType != ExpressionType.MemberAccess) throw new Exception("Include 参数类型错误,表达式类型应该为 MemberAccess");
|
||||
if (typeof(IEnumerable).IsAssignableFrom(expBody.Type)) throw new Exception("Include 参数类型错误,集合属性请使用 IncludeMany");
|
||||
var tb = _commonUtils.GetTableByEntity(expBody.Type);
|
||||
if (tb == null) throw new Exception("Include 参数类型错误");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user