Class ServiceInjectionAnalyzer
- Namespace
- Blazing.Mvvm.Analyzers.Analyzers
- Assembly
- Blazing.Mvvm.Analyzers.dll
Analyzer that detects [Inject] attribute usage in ViewModels and recommends constructor injection instead. In Blazor MVVM, ViewModels should use constructor injection, not property injection with [Inject].
[DiagnosticAnalyzer("C#", new string[] { })]
public class ServiceInjectionAnalyzer : DiagnosticAnalyzerInheritance
Inherited Members
Properties
SupportedDiagnostics
Returns a set of descriptors for the diagnostics that this analyzer is capable of producing.
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }Property Value
Methods
Initialize(AnalysisContext)
Called once at session start to register actions in the analysis context.
public override void Initialize(AnalysisContext context)Parameters
contextAnalysisContext