Skip to content

Commit d2a4a3f

Browse files
committed
Staying with the previously referenced LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType in LinqExtensions.
1 parent 2f3853d commit d2a4a3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

AutoMapper.AspNetCore.OData.EFCore/LinqExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public static Expression GetSkipCall(this Expression expression, int? skip)
398398
(
399399
expression.Type.IsIQueryable() ? typeof(Queryable) : typeof(Enumerable),
400400
"Skip",
401-
new[] { expression.GetUnderlyingElementType() },
401+
new[] { LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType(expression) },
402402
expression,
403403
Expression.Constant(skip.Value)
404404
);
@@ -412,7 +412,7 @@ public static Expression GetTakeCall(this Expression expression, int? top)
412412
(
413413
expression.Type.IsIQueryable() ? typeof(Queryable) : typeof(Enumerable),
414414
"Take",
415-
new[] { expression.GetUnderlyingElementType() },
415+
new[] { LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType(expression) },
416416
expression,
417417
Expression.Constant(top.Value)
418418
);
@@ -433,15 +433,15 @@ public static Expression GetOrderByCountCall(this Expression expression, CountNo
433433

434434
public static Expression GetOrderByCountCall(this Expression expression, CountNode countNode, string methodName, ODataQueryContext context, string selectorParameterName = "a")
435435
{
436-
Type sourceType = expression.GetUnderlyingElementType();
436+
Type sourceType = LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType(expression);
437437
ParameterExpression param = Expression.Parameter(sourceType, selectorParameterName);
438438

439439
Expression countSelector;
440440

441441
if (countNode.FilterClause is not null)
442442
{
443443
string memberFullName = countNode.GetPropertyPath();
444-
Type filterType = sourceType.GetMemberInfoFromFullName(memberFullName).GetMemberType().GetUnderlyingElementType();
444+
Type filterType = LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType(sourceType.GetMemberInfoFromFullName(memberFullName).GetMemberType());
445445
LambdaExpression filterExpression = countNode.FilterClause.GetFilterExpression(filterType, context);
446446
countSelector = param.MakeSelector(memberFullName).GetCountCall(filterExpression);
447447
}
@@ -465,7 +465,7 @@ public static Expression GetOrderByCountCall(this Expression expression, CountNo
465465

466466
public static Expression GetOrderByCall(this Expression expression, string memberFullName, string methodName, string selectorParameterName = "a")
467467
{
468-
Type sourceType = expression.GetUnderlyingElementType();
468+
Type sourceType = LogicBuilder.Expressions.Utils.TypeExtensions.GetUnderlyingElementType(expression);
469469
MemberInfo memberInfo = sourceType.GetMemberInfoFromFullName(memberFullName);
470470
return Expression.Call
471471
(

0 commit comments

Comments
 (0)