ValidationOptions.TryGetValidatablePropertyInfo Méthode

Définition

Tente d’obtenir des informations de validation pour une propriété déclarée sur le type spécifié ou l’un de ses super-types.

public:
 bool TryGetValidatablePropertyInfo(Type ^ type, System::String ^ propertyName, [Runtime::InteropServices::Out] Microsoft::Extensions::Validation::IValidatableInfo ^ % validatablePropertyInfo);
[System.Diagnostics.CodeAnalysis.Experimental("ASP0029", UrlFormat="https://aka.ms/aspnet/analyzer/{0}")]
public bool TryGetValidatablePropertyInfo(Type type, string propertyName, out Microsoft.Extensions.Validation.IValidatableInfo? validatablePropertyInfo);
[<System.Diagnostics.CodeAnalysis.Experimental("ASP0029", UrlFormat="https://aka.ms/aspnet/analyzer/{0}")>]
member this.TryGetValidatablePropertyInfo : Type * string * IValidatableInfo -> bool
Public Function TryGetValidatablePropertyInfo (type As Type, propertyName As String, ByRef validatablePropertyInfo As IValidatableInfo) As Boolean

Paramètres

type
Type

Type qui déclare ou hérite de la propriété.

propertyName
String

Nom de la propriété CLR à rechercher.

validatablePropertyInfo
IValidatableInfo

Lorsque cette méthode est retournée, contient les informations de validation de la propriété, si une propriété portant le nom spécifié a été trouvée ; sinon, null.

Retours

true si une propriété validable portant le nom spécifié a été trouvée ; sinon, false.

Attributs

Remarques

Les membres déclarés directement en priorité sur type les membres hérités de super-types, correspondant à l’ordre dans lequel ValidateAsync(Object, ValidateContext, CancellationToken) les membres visitent.

S’applique à