private static void CollectMemberAccesses(MemberAccessingEventArgs args, ISet <IdentifierNameSyntax> identifiers, SemanticModel semanticModel)
 {
     if (args.Symbol is IParameterSymbol &&
         !semanticModel.IsExtensionMethod(args.Identifier.Parent) &&
         !args.Symbol.HasConstraint(ObjectConstraint.NotNull, args.ProgramState))
     {
         identifiers.Add(args.Identifier);
     }
 }
Beispiel #2
0
 private static void CollectMemberAccesses(MemberAccessingEventArgs args, ISet <IdentifierNameSyntax> identifiers, SemanticModel semanticModel)
 {
     if (args.Symbol is IParameterSymbol &&
         !semanticModel.IsExtensionMethod(args.Identifier.Parent) &&
         !args.Symbol.HasConstraint(ObjectConstraint.NotNull, args.ProgramState) &&
         !args.Symbol.GetAttributes(KnownType.Microsoft_AspNetCore_Mvc_FromServicesAttribute).Any())
     {
         identifiers.Add(args.Identifier);
     }
 }
 private void MemberAccessingHandler(object sender, MemberAccessingEventArgs args) =>
 CollectMemberAccesses(args, this.identifiers, this.syntaxNodeAnalysisContext.SemanticModel);