From 3b98b1ef364726407adc23a60287d31462a202a2 Mon Sep 17 00:00:00 2001 From: Rhodon Date: Wed, 11 Jan 2023 14:26:43 +0100 Subject: [PATCH] Some clarifying comments for extracting the original expression type in a member expression --- .../Services/ProjectableExpressionReplacer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EntityFrameworkCore.Projectables/Services/ProjectableExpressionReplacer.cs b/src/EntityFrameworkCore.Projectables/Services/ProjectableExpressionReplacer.cs index 84f5283..d304b29 100644 --- a/src/EntityFrameworkCore.Projectables/Services/ProjectableExpressionReplacer.cs +++ b/src/EntityFrameworkCore.Projectables/Services/ProjectableExpressionReplacer.cs @@ -77,6 +77,8 @@ namespace EntityFrameworkCore.Projectables.Services var nodeExpression = node.Expression switch { UnaryExpression { NodeType: ExpressionType.Convert, Type: { IsInterface: true } type, Operand: { } operand } when type.IsAssignableFrom(operand.Type) + // This is an interface member. Operand contains the concrete (or at least more concrete) expression, + // from which we can try to find the concrete member. => operand, _ => node.Expression };