ValidationOptions.TryGetValidatablePropertyInfo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to get validation information for a property declared on the specified type or any of its 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
Parameters
- type
- Type
The type that declares or inherits the property.
- propertyName
- String
The CLR property name to look up.
- validatablePropertyInfo
- IValidatableInfo
When this method returns, contains the validation information
for the property, if a property with the specified name was found; otherwise,
null.
Returns
true if a validatable property with the specified name was found;
otherwise, false.
- Attributes
Remarks
Members declared directly on type take precedence over members inherited from super-types, matching the order in which ValidateAsync(Object, ValidateContext, CancellationToken) visits members.