NDepend.API Documentation
GetRule Method
NDepend.CodeQuery Namespace > ExtensionMethodsQuery Class : GetRule Method
The code query from which the rule object is inferred.
Gets a NDepend.Issue.IRule object from a IQuery object.
Syntax
[Extension()]
public static IRule GetRule( 
   IQuery query
)

Parameters

query
The code query from which the rule object is inferred.
Remarks
The returned rule NDepend.Issue.IRule.NDepend.Issue.IRule.Provider equals NDepend.Issue.RuleProvider.NDepend.Issue.RuleProvider.CodeQueryRule
The returned rule NDepend.Issue.IRule.NDepend.Issue.IRule.IsCritical equals query.IsCriticalRule.
These ExtensionMethodsQuery methods are used for NDepend.Issue.IRule.NDepend.Issue.IRule.Name, NDepend.Issue.IRule.NDepend.Issue.IRule.TryGetDescription and NDepend.Issue.IRule.NDepend.Issue.IRule.TryGetHowToFix.
- TryGetQueryName (if fails, the gets the first 60 char of the code query string.
- TryGetQueryDescription.
- TryGetRuleHowToFix.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsQuery Class
ExtensionMethodsQuery Members