NDepend.API Documentation
OlderVersion<T> Method (ExtensionMethodsCQLinqCompare)
NDepend.Reserved.CQLinq Namespace > ExtensionMethodsCQLinqCompare Class : OlderVersion<T> Method
T is the closed NDepend.CodeModel.ICodeElement generic type, like in ICodeElement<IMethod> or ICodeElement<ICodeBase> for example.
This NDepend.CodeModel.ICodeElement object. A NDepend.CodeModel.ICodeElement object can be a NDepend.CodeModel.ICodeElement or a NDepend.CodeModel.ICodeBase object.
Returns the older version of this codeElement object. This method can only be called in a ICQLinqExecutionContext, otherwise the method NDepend.CodeModel.ICompareContext.NDepend.CodeModel.ICompareContext.OlderVersion<T> must be called instead.
Syntax
[Extension()]
public static T OlderVersion<T>( 
   T codeElement
)
where T: class, ICodeElement

Parameters

codeElement
This NDepend.CodeModel.ICodeElement object. A NDepend.CodeModel.ICodeElement object can be a NDepend.CodeModel.ICodeElement or a NDepend.CodeModel.ICodeBase object.

Type Parameters

T
T is the closed NDepend.CodeModel.ICodeElement generic type, like in ICodeElement<IMethod> or ICodeElement<ICodeBase> for example.
Exceptions
ExceptionDescription
This extension method cannot be called from a program consuming NDepend.API. In such context, the method NDepend.CodeModel.ICompareContext.NDepend.CodeModel.ICompareContext.OlderVersion<T> must be called instead.
Remarks
If this code element is already the older version, returns this code element.
If this code element has been added and has no corresponding older version, returns null.
In the context of a CQLinq compiled query, this method has a constant time complexity.
Requirements

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

See Also

Reference

ExtensionMethodsCQLinqCompare Class
ExtensionMethodsCQLinqCompare Members