Partager via


ModelAnnotation.RegisterAnnotationClass<TAnnotation>, méthode

Inscrit le type d'annotation fourni en même temps que l'annotation.

Espace de noms :  Microsoft.Data.Schema.SchemaModel
Assembly :  Microsoft.Data.Schema (dans Microsoft.Data.Schema.dll)

Syntaxe

'Déclaration
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 ne prend pas en charge les types ou les méthodes génériques.

Paramètres de type

Paramètres

  • isSerializable
    Type : System.Boolean
    bool qui indique si l'annotation est sérialisable.
  • requiresControllerLock
    Type : System.Boolean
    bool qui indique si les instances de cette classe nécessitent un verrou de contrôleur.

Valeur de retour

Type : Microsoft.Data.Schema.SchemaModel.ModelAnnotationClass
Métadonnées d'une annotation.

Exceptions

Exception Condition
ModelRegistrationException

La valeur de paramètre générique TAnnotation a déjà été inscrite.

Sécurité .NET Framework

Voir aussi

Référence

ModelAnnotation Classe

Microsoft.Data.Schema.SchemaModel, espace de noms

InstantiateAnnotationCallback<TAnnotation>