NDepend.API Documentation
Compile(String,ICompareContext) Method
NDepend.CodeQuery Namespace > ExtensionMethodsQuery Class > Compile Method : Compile(String,ICompareContext) Method
This code query string.
The NDepend.CodeModel.ICompareContext object against which to compile.
Compile this code query string against a NDepend.CodeModel.ICompareContext object. This overload of Compile(String,ICodeBase) is required if the code query is meant to be executed in a comparison context.
Syntax

Parameters

queryString
This code query string.
compareContext
The NDepend.CodeModel.ICompareContext object against which to compile.

Return Value

This code query compiled.
Remarks
The NDepend.CodeModel.ICompareContext object is needed because the code query might reference some code elements by name.
In such situation, code elements are resolved by name against the code base NDepend.CodeModel.ICompareContext.NewerCodeBase.
The property IQueryCompiledSuccess.IQueryCompiledSuccess.RelyOnCompareContext is equal to true if a code query is meant to be executed in a comparison context.
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
Overload List
ICompareContext Interface
CreateCompareContextWithOlder Method
ExtensionMethodsCQLinqCompare Class
RelyOnCompareContext Property
CompileMany(IEnumerable<String>,ICompareContext) Method
TryCompareSourceWith(ISourceDecl,ISourceDecl) Method