Exemplo n.º 1
0
    public StartupAnalysisBuilder(StartupAnalyzer analyzer, StartupSymbols startupSymbols)
    {
        _analyzer      = analyzer;
        StartupSymbols = startupSymbols;

#pragma warning disable RS1024 // Compare symbols correctly
        _analysesByType = new Dictionary <INamedTypeSymbol, List <object> >(SymbolEqualityComparer.Default);
#pragma warning restore RS1024 // Compare symbols correctly
        _lock = new object();
    }
Exemplo n.º 2
0
    public MinimalStartupTest()
    {
        StartupAnalyzer = new StartupAnalyzer();

        Analyses = new ConcurrentBag <object>();
        ConfigureServicesMethods = new ConcurrentBag <IMethodSymbol>();
        ConfigureMethods         = new ConcurrentBag <IMethodSymbol>();
        StartupAnalyzer.ServicesAnalysisCompleted    += (sender, analysis) => Analyses.Add(analysis);
        StartupAnalyzer.OptionsAnalysisCompleted     += (sender, analysis) => Analyses.Add(analysis);
        StartupAnalyzer.MiddlewareAnalysisCompleted  += (sender, analysis) => Analyses.Add(analysis);
        StartupAnalyzer.ConfigureServicesMethodFound += (sender, method) => ConfigureServicesMethods.Add(method);
        StartupAnalyzer.ConfigureMethodFound         += (sender, method) => ConfigureMethods.Add(method);
    }