ValidationContext Konstruktoren
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Initialisiert eine neue Instanz der ValidationContext-Klasse.
Überlädt
| Name | Beschreibung |
|---|---|
| ValidationContext(Object) |
Initialisiert eine neue Instanz der Klasse mithilfe der ValidationContext angegebenen Objektinstanz. |
| ValidationContext(Object, IDictionary<Object,Object>) |
Initialisiert eine neue Instanz der Klasse mithilfe des ValidationContext angegebenen Objekts und eines optionalen Eigenschaftenbehälters. |
| ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>) |
Initialisiert eine neue Instanz der ValidationContext Klasse mithilfe des Dienstanbieters und des Wörterbuchs von Dienstkunden. |
| ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>) |
Erstellt eine ValidationContext für eine bestimmte Objektinstanz mit einem |
ValidationContext(Object)
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
Initialisiert eine neue Instanz der Klasse mithilfe der ValidationContext angegebenen Objektinstanz.
public:
ValidationContext(System::Object ^ instance);
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance);
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object)
Parameter
- instance
- Object
Die zu überprüfende Objektinstanz. Es kann nicht nullwerden.
- Attribute
Ausnahmen
instance ist null.
Gilt für:
ValidationContext(Object, IDictionary<Object,Object>)
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
Initialisiert eine neue Instanz der Klasse mithilfe des ValidationContext angegebenen Objekts und eines optionalen Eigenschaftenbehälters.
public:
ValidationContext(System::Object ^ instance, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object> items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, items As IDictionary(Of Object, Object))
Parameter
- instance
- Object
Die zu überprüfende Objektinstanz. Es kann nicht nullwerden.
- items
- IDictionary<Object,Object>
Ein optionaler Satz von Schlüssel-Wert-Paaren, die Verbrauchern zur Verfügung gestellt werden sollen.
- Attribute
Ausnahmen
instance ist null.
Hinweise
Wenn items ja null, wird ein leeres Wörterbuch erstellt. Wenn items keine Null ist, wird der Satz von Schlüssel-Wert-Paaren in ein neues Wörterbuch kopiert, hindern Die Verbraucher daran, das ursprüngliche Wörterbuch zu ändern.
Gilt für:
ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>)
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
Initialisiert eine neue Instanz der ValidationContext Klasse mithilfe des Dienstanbieters und des Wörterbuchs von Dienstkunden.
public:
ValidationContext(System::Object ^ instance, IServiceProvider ^ serviceProvider, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, IServiceProvider serviceProvider, System.Collections.Generic.IDictionary<object,object> items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))
Parameter
- instance
- Object
Das zu überprüfende Objekt. Dieser Parameter ist erforderlich.
- serviceProvider
- IServiceProvider
Das Objekt, das die IServiceProvider Schnittstelle implementiert. Dieser Parameter ist optional.
- items
- IDictionary<Object,Object>
Ein Wörterbuch mit Schlüssel-Wert-Paaren, das den Dienstkunden zur Verfügung gestellt werden soll. Dieser Parameter ist optional.
- Attribute
Ausnahmen
instance ist null.
Hinweise
Der serviceProvider Parameter stellt einen Dienst dar, der von der GetService Methode verwendet werden kann, um eine benutzerdefinierte Überprüfung durchzuführen.
Wenn der items Parameter lautet null, wird ein leeres Wörterbuch erstellt. Wenn der Parameter nicht nullangegeben ist, wird der Satz von Schlüssel-Wert-Paaren in ein neues Wörterbuch kopiert, wodurch verhindert wird, dass die Dienstkunden das ursprüngliche Wörterbuch ändern.
Gilt für:
ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>)
- Quelle:
- ValidationContext.cs
- Quelle:
- ValidationContext.cs
Erstellt eine ValidationContext für eine bestimmte Objektinstanz mit einem displayName, einem optionalen serviceProviderund einem optionalen Eigenschaftenbehälter von items.
public:
ValidationContext(System::Object ^ instance, System::String ^ displayName, IServiceProvider ^ serviceProvider, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, string displayName, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * string * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, displayName As String, serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))
Parameter
- instance
- Object
Die zu überprüfende Objektinstanz. Es kann nicht nullwerden.
- displayName
- String
Der Anzeigename, der der Objektinstanz zugeordnet ist.
- serviceProvider
- IServiceProvider
Optional IServiceProvider , wenn GetService(Type) sie aufgerufen wird.
Wenn dies der Wert ist null, GetService(Type) wird immer zurückgegeben null.
- items
- IDictionary<Object,Object>
Optionaler Satz von Schlüssel-Wert-Paaren, die Verbrauchern über Itemsbereitgestellt werden sollen.
Wenn null, wird ein leeres Wörterbuch erstellt. Wenn nicht null, wird die Gruppe von Schlüssel-Wert-Paaren in ein neues Wörterbuch kopiert, hindern Benutzer daran, das ursprüngliche Wörterbuch zu ändern.
Ausnahmen
Wann instance ist null
Hinweise
Dieser Konstruktor ist trim-safe, da er keine Spiegelung verwendet, um den Typ des instance zu unterstützenden Einstellungsnamens aufzulösen.