How do I retrieve all attributes of a .NET method using NDepend?
Question
I would like to retrieve (using NDepend) a list of all attributes of a given type that are declared on a method. Something like
warnif count > 0 from m in JustMyCode.Methods where
m.HasAttribute("MyNamespace.MyAttribute")
select new { m, m.Attributes("MyNamespace.MyAttribute") }
Is this possible? Is there a radically different way of doing this? Thanks!
La solution
I am not sure to understand completely the question.
If you mean that a method is tagged with several occurrences of MyNamespace.MyAttribute
NDepend won't give more info than true
for the expression m.HasAttribute("MyNamespace.MyAttribute")
.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow