Validator.ValidateObject Metódus
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.
Meghatározza, hogy a megadott objektum érvényes-e.
Túlterhelések
| Name | Description |
|---|---|
| ValidateObject(Object, ValidationContext) |
Meghatározza, hogy a megadott objektum érvényes-e az érvényesítési környezet használatával. |
| ValidateObject(Object, ValidationContext, Boolean) |
Meghatározza, hogy a megadott objektum érvényes-e az érvényesítési környezettel, és egy olyan érték, amely meghatározza, hogy az összes tulajdonság érvényesíthető-e. |
ValidateObject(Object, ValidationContext)
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
Meghatározza, hogy a megadott objektum érvényes-e az érvényesítési környezet használatával.
public:
static void ValidateObject(System::Object ^ instance, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext 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.")]
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
[<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.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
Public Shared Sub ValidateObject (instance As Object, validationContext As ValidationContext)
Paraméterek
- instance
- Object
Az érvényesítendő objektum.
- validationContext
- ValidationContext
Az érvényesítendő objektumot leíró környezet.
- Attribútumok
Kivételek
Az objektum érvénytelen.
instance az null.
instance nem egyezik a ObjectInstance bekapcsolva validationContext.
Megjegyzések
Ez a metódus kiértékeli az objektumtípushoz csatolt példányokat ValidationAttribute .
A következőre érvényes:
ValidateObject(Object, ValidationContext, Boolean)
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
- Forrás:
- Validator.cs
Meghatározza, hogy a megadott objektum érvényes-e az érvényesítési környezettel, és egy olyan érték, amely meghatározza, hogy az összes tulajdonság érvényesíthető-e.
public:
static void ValidateObject(System::Object ^ instance, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext, bool validateAllProperties);
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, bool validateAllProperties);
[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 static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, bool validateAllProperties);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, bool validateAllProperties);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, bool validateAllProperties);
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext * bool -> unit
[<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.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext * bool -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext * bool -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
static member ValidateObject : obj * System.ComponentModel.DataAnnotations.ValidationContext * bool -> unit
Public Shared Sub ValidateObject (instance As Object, validationContext As ValidationContext, validateAllProperties As Boolean)
Paraméterek
- instance
- Object
Az érvényesítendő objektum.
- validationContext
- ValidationContext
Az érvényesítendő objektumot leíró környezet.
- validateAllProperties
- Boolean
trueaz összes tulajdonság ellenőrzése; egyéb esetben. false
- Attribútumok
Kivételek
instance érvénytelen.
instance az null.
instance nem egyezik a ObjectInstance bekapcsolva validationContext.
Megjegyzések
Ez a metódus kiértékeli az objektumtípushoz csatolt példányokat ValidationAttribute .