ValidationContext Konstruktorok
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Inicializálja a ValidationContext osztály új példányát.
Túlterhelések
| Name | Description |
|---|---|
| ValidationContext(Object) |
Inicializálja az osztály új példányát a ValidationContext megadott objektumpéldány használatával. |
| ValidationContext(Object, IDictionary<Object,Object>) |
Inicializálja az osztály új példányát a ValidationContext megadott objektum és egy opcionális tulajdonságcsomag használatával. |
| ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>) |
Inicializálja az osztály új példányát a ValidationContext szolgáltató és a szolgáltatásfelhasználók szótára használatával. |
| ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>) |
Létrehoz egy ValidationContext adott objektumpéldányt egy |
ValidationContext(Object)
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
Inicializálja az osztály új példányát a ValidationContext megadott objektumpéldány használatával.
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)
Paraméterek
- instance
- Object
Az érvényesítendő objektumpéldány. Nem lehet null.
- Attribútumok
Kivételek
instance az null.
A következőre érvényes:
ValidationContext(Object, IDictionary<Object,Object>)
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
Inicializálja az osztály új példányát a ValidationContext megadott objektum és egy opcionális tulajdonságcsomag használatával.
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))
Paraméterek
- instance
- Object
Az érvényesítendő objektumpéldány. Nem lehet null.
- items
- IDictionary<Object,Object>
Választható kulcs/érték párok készlete, amely elérhetővé válik a fogyasztók számára.
- Attribútumok
Kivételek
instance az null.
Megjegyzések
Ha items igen null, egy üres szótár jön létre. Ha items nem null, a kulcs-érték párok halmaza egy új szótárba lesz másolva, megakadályozva, hogy a felhasználók módosítsák az eredeti szótárat.
A következőre érvényes:
ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>)
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
Inicializálja az osztály új példányát a ValidationContext szolgáltató és a szolgáltatásfelhasználók szótára használatával.
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))
Paraméterek
- instance
- Object
Az érvényesítendő objektum. Ez a paraméter kötelező.
- serviceProvider
- IServiceProvider
Az interfészt megvalósító IServiceProvider objektum. Ez a paraméter nem kötelező.
- items
- IDictionary<Object,Object>
Kulcs-érték párok szótára, amely elérhetővé válik a szolgáltatásfelhasználók számára. Ez a paraméter nem kötelező.
- Attribútumok
Kivételek
instance az null.
Megjegyzések
A serviceProvider paraméter egy olyan szolgáltatást jelöl, amelyet a GetService metódus az egyéni ellenőrzés végrehajtásához használhat.
Ha a items paraméter az null, egy üres szótár jön létre. Ha a paraméter nem null, a rendszer a kulcs/érték párok készletét egy új szótárba másolja, amely megakadályozza, hogy a szolgáltatásfelhasználók módosítsák az eredeti szótárat.
A következőre érvényes:
ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>)
- Forrás:
- ValidationContext.cs
- Forrás:
- ValidationContext.cs
Létrehoz egy ValidationContext adott objektumpéldányt egy displayName, egy opcionális serviceProviderés egy opcionális tulajdonságcsomaggal 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))
Paraméterek
- instance
- Object
Az érvényesítendő objektumpéldány. Nem lehet null.
- displayName
- String
Az objektumpéldányhoz társított megjelenítendő név.
- serviceProvider
- IServiceProvider
A híváskor GetService(Type) nem kötelező IServiceProvider használni.
Ha igen null, GetService(Type) mindig visszatér null.
- items
- IDictionary<Object,Object>
Választható kulcs-/érték párok készlete, a felhasználók számára elérhetővé tétele a következőn keresztül Items: .
Ha null, akkor létrejön egy üres szótár. Ha nem null, akkor a kulcs-érték párok halmaza egy új szótárba lesz másolva, így a felhasználók nem módosíthatják az eredeti szótárat.
Kivételek
Mikor instance van null
Megjegyzések
Ez a konstruktor vágásbiztos, mert nem használja a tükröződést a DisplayName beállításának támogatásához használt típus instance feloldásához.