Class AnnotatableExtensions
- Namespace
- LinqToDB.Internal.Infrastructure
- Assembly
- linq2db.dll
Extension methods for IReadOnlyAnnotatable and IMutableAnnotatable.
public static class AnnotatableExtensions
- Inheritance
-
objectAnnotatableExtensions
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
annotatableIMutableAnnotatableThe object to add annotations to.
annotationsIEnumerable<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
annotatableIReadOnlyAnnotatableThe object whose annotations should be rendered.
indentintThe 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
annotatableIReadOnlyAnnotatableThe object to find the annotation on.
annotationNamestringThe key of the annotation to find.
Returns
- IAnnotation
The annotation with the specified name.