- 补充 Expression IEnumerable<T>.Contains 的支持,之前只能数组或IList<T>;

This commit is contained in:
28810
2019-04-25 17:28:25 +08:00
parent 169cf596c0
commit 205421f7e0
11 changed files with 64 additions and 55 deletions

View File

@ -90,14 +90,12 @@ namespace FreeSql.Sqlite {
argIndex++;
}
if (objType == null) objType = callExp.Method.DeclaringType;
if (objType != null) {
if (objType != null || objType.IsArray || typeof(IList).IsAssignableFrom(callExp.Method.DeclaringType)) {
var left = objExp == null ? null : getExp(objExp);
if (objType.IsArray || typeof(IList).IsAssignableFrom(callExp.Method.DeclaringType)) {
switch (callExp.Method.Name) {
case "Contains":
//判断 in
return $"({getExp(callExp.Arguments[argIndex])}) in {left}";
}
switch (callExp.Method.Name) {
case "Contains":
//判断 in
return $"({getExp(callExp.Arguments[argIndex])}) in {left}";
}
}
break;