Some clarifying comments for extracting the original expression type in a member expression

This commit is contained in:
Rhodon
2023-01-11 14:26:43 +01:00
parent 423879185e
commit 3b98b1ef36
@@ -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
};