diff --git a/src/EntityFrameworkCore.Projectables.Generator/ProjectionExpressionGenerator.cs b/src/EntityFrameworkCore.Projectables.Generator/ProjectionExpressionGenerator.cs index c295678..0c8d4f3 100644 --- a/src/EntityFrameworkCore.Projectables.Generator/ProjectionExpressionGenerator.cs +++ b/src/EntityFrameworkCore.Projectables.Generator/ProjectionExpressionGenerator.cs @@ -19,9 +19,6 @@ namespace EntityFrameworkCore.Projectables.Generator { private const string ProjectablesAttributeName = "EntityFrameworkCore.Projectables.ProjectableAttribute"; - public void Initialize(GeneratorInitializationContext context) => - context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); - public void Initialize(IncrementalGeneratorInitializationContext context) { // Do a simple filter for members diff --git a/src/EntityFrameworkCore.Projectables.Generator/SyntaxReceiver.cs b/src/EntityFrameworkCore.Projectables.Generator/SyntaxReceiver.cs deleted file mode 100644 index f205f96..0000000 --- a/src/EntityFrameworkCore.Projectables.Generator/SyntaxReceiver.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EntityFrameworkCore.Projectables.Generator -{ - public class SyntaxReceiver : ISyntaxReceiver - { - public List? Candidates { get; private set; } - - public void OnVisitSyntaxNode(SyntaxNode syntaxNode) - { - if (syntaxNode is MemberDeclarationSyntax memberDeclarationSyntax && memberDeclarationSyntax.AttributeLists.Count > 0) - { - var hasProjectableAttribute = memberDeclarationSyntax.AttributeLists - .SelectMany(x => x.Attributes) - .Any(x => x.Name.ToString().Contains("Projectable")); - - if (hasProjectableAttribute) - { - if (Candidates == null) - { - Candidates = new(); - } - - Candidates.Add(memberDeclarationSyntax); - } - } - } - } -}