Fixed code gen issue for Projectable extension methods using other projectable extension methods

This commit is contained in:
Koen Bekkenutte
2021-07-02 03:28:40 +08:00
parent 0899408ed1
commit 659f10ac10
7 changed files with 105 additions and 1 deletions
@@ -51,7 +51,17 @@ namespace EntityFrameworkCore.Projectables.Generator
if (symbolInfo.Symbol is not null)
{
if (symbolInfo.Symbol.Kind is SymbolKind.Property or SymbolKind.Method or SymbolKind.Field && SymbolEqualityComparer.Default.Equals(symbolInfo.Symbol.ContainingType, _targetTypeSymbol))
if (symbolInfo.Symbol is IMethodSymbol methodSymbol && methodSymbol.IsExtensionMethod)
{
if (SymbolEqualityComparer.Default.Equals(symbolInfo.Symbol.ContainingType, _targetTypeSymbol))
{
//return SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression,
// methodSymbol.ReducedFrom.Sym
//);
//throw new Exception("foo");
}
}
else if (symbolInfo.Symbol.Kind is SymbolKind.Property or SymbolKind.Method or SymbolKind.Field && SymbolEqualityComparer.Default.Equals(symbolInfo.Symbol.ContainingType, _targetTypeSymbol))
{
return SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName("@this"),