Banned Symbols Analyzer partial ban [Answered]
I currently ban
DbContext.Set<T>()
methods in my project using https://github.com/dotnet/roslyn-analyzers/tree/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers
but I'd like to ban them only partially. Meaning, I want to disallow concrete types, but allow generic parameters. For example
is that even possible?5 Replies
You could write your own analyzer
Sure I could, but
a) One already exists, so maybe it does already have this feature
b) That would mean trying to make sense of the Roslyn APIs, and I'd rather learn ancient Sumerian in cursive
You cannot
Your only option is writing an analyzer
✅ This post has been marked as answered!