Share via


ModelAnnotation.RegisterAnnotationClass<TAnnotation> Method

Registers the provided annotation type together with the annotation.

Namespace:  Microsoft.Data.Schema.SchemaModel
Assembly:  Microsoft.Data.Schema (in Microsoft.Data.Schema.dll)

Syntax

'Declaration
Protected Shared Function RegisterAnnotationClass(Of TAnnotation As ModelAnnotation) ( _
    factoryMethod As InstantiateAnnotationCallback(Of TAnnotation), _
    isSerializable As Boolean, _
    requiresControllerLock As Boolean _
) As ModelAnnotationClass
protected static ModelAnnotationClass RegisterAnnotationClass<TAnnotation>(
    InstantiateAnnotationCallback<TAnnotation> factoryMethod,
    bool isSerializable,
    bool requiresControllerLock
)
where TAnnotation : ModelAnnotation
protected:
generic<typename TAnnotation>
where TAnnotation : ModelAnnotation
static ModelAnnotationClass^ RegisterAnnotationClass(
    InstantiateAnnotationCallback<TAnnotation>^ factoryMethod, 
    bool isSerializable, 
    bool requiresControllerLock
)
static member RegisterAnnotationClass : 
        factoryMethod:InstantiateAnnotationCallback<'TAnnotation> * 
        isSerializable:bool * 
        requiresControllerLock:bool -> ModelAnnotationClass  when 'TAnnotation : ModelAnnotation
JScript does not support generic types or methods.

Type Parameters

Parameters

  • isSerializable
    Type: System.Boolean
    A bool that indicates whether the annotation is serializable.
  • requiresControllerLock
    Type: System.Boolean
    A bool that indicates whether instances of this class require a controller lock.

Return Value

Type: Microsoft.Data.Schema.SchemaModel.ModelAnnotationClass
The metadata for an annotation.

Exceptions

Exception Condition
ModelRegistrationException

The TAnnotation Generic parameter value has already been registered.

.NET Framework Security

See Also

Reference

ModelAnnotation Class

Microsoft.Data.Schema.SchemaModel Namespace

InstantiateAnnotationCallback<TAnnotation>