Table of Contents

Class AnnotatableExtensions

Namespace
LinqToDB.Internal.Infrastructure
Assembly
linq2db.dll

Extension methods for IReadOnlyAnnotatable and IMutableAnnotatable.

public static class AnnotatableExtensions
Inheritance
object
AnnotatableExtensions

Methods

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

Adds annotations to an object. If annotatable is an AnnotatableBase, routes through its AddAnnotations(IEnumerable<IAnnotation>) override so subclass customizations are respected.

public static void AddAnnotations(this IMutableAnnotatable annotatable, IEnumerable<IAnnotation> annotations)

Parameters

annotatable IMutableAnnotatable

The object to add annotations to.

annotations IEnumerable<IAnnotation>

The annotations to be added.

AnnotationsToDebugString(IReadOnlyAnnotatable, int)

Gets the debug string for all annotations declared on the object.

public static string AnnotationsToDebugString(this IReadOnlyAnnotatable annotatable, int indent = 0)

Parameters

annotatable IReadOnlyAnnotatable

The object whose annotations should be rendered.

indent int

The number of indent spaces to use before each new line.

Returns

string

Debug string representation of all annotations.

GetAnnotation(IReadOnlyAnnotatable, string)

Gets the annotation with the given name, throwing if it does not exist.

public static IAnnotation GetAnnotation(this IReadOnlyAnnotatable annotatable, string annotationName)

Parameters

annotatable IReadOnlyAnnotatable

The object to find the annotation on.

annotationName string

The key of the annotation to find.

Returns

IAnnotation

The annotation with the specified name.