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
- TAnnotation
Type pour un objet qui hérite de ModelAnnotation.
Paramètres
- factoryMethod
Type : Microsoft.Data.Schema.SchemaModel.InstantiateAnnotationCallback<TAnnotation>
Objet InstantiateAnnotationCallback<TAnnotation> qui représente la méthode capable d'instancier l'annotation.
- 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
- Confiance totale accordée à l'appelant immédiat. Ce membre ne peut pas être utilisé par du code d'un niveau de confiance partiel. Pour plus d'informations, consultez Utilisation de bibliothèques à partir de code d'un niveau de confiance partiel.