ValidationAttribute.IsValid Yöntem
Tanım
Belirtilen nesnenin geçerli olup olmadığını denetler.Checks whether the specified object is valid.
Aşırı Yüklemeler
| IsValid(Object) |
Nesnenin belirtilen değerinin geçerli olup olmadığını belirler.Determines whether the specified value of the object is valid. |
| IsValid(Object, ValidationContext) |
Geçerli doğrulama özniteliğine göre belirtilen değeri doğrular.Validates the specified value with respect to the current validation attribute. |
IsValid(Object)
Nesnenin belirtilen değerinin geçerli olup olmadığını belirler.Determines whether the specified value of the object is valid.
public:
virtual bool IsValid(System::Object ^ value);
public:
abstract bool IsValid(System::Object ^ value);
public virtual bool IsValid (object value);
public virtual bool IsValid (object? value);
public abstract bool IsValid (object value);
abstract member IsValid : obj -> bool
override this.IsValid : obj -> bool
abstract member IsValid : obj -> bool
Public Overridable Function IsValid (value As Object) As Boolean
Public MustOverride Function IsValid (value As Object) As Boolean
Parametreler
- value
- Object
Doğrulanacak nesnenin değeri.The value of the object to validate.
Döndürülenler
true Belirtilen değer geçerliyse; Aksi takdirde, false .true if the specified value is valid; otherwise, false.
Özel durumlar
Geçerli öznitelik hatalı biçimlendirilmiş.The current attribute is malformed.
Hiçbir aşırı yüklemesi IsValid türetilmiş bir sınıf tarafından uygulanmadı.Neither overload of IsValid has been implemented by a derived class.
Açıklamalar
Sınıfından devralma yaparsanız ValidationAttribute , bu yöntemde doğrulama mantığını uygulamanız gerekir.If you inherit from the ValidationAttribute class, you must implement the validation logic in this method.
Şunlara uygulanır
IsValid(Object, ValidationContext)
Geçerli doğrulama özniteliğine göre belirtilen değeri doğrular.Validates the specified value with respect to the current validation attribute.
protected:
virtual System::ComponentModel::DataAnnotations::ValidationResult ^ IsValid(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
protected virtual System.ComponentModel.DataAnnotations.ValidationResult IsValid (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
protected virtual System.ComponentModel.DataAnnotations.ValidationResult? IsValid (object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
abstract member IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
override this.IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
Protected Overridable Function IsValid (value As Object, validationContext As ValidationContext) As ValidationResult
Parametreler
- value
- Object
Doğrulanacak değer.The value to validate.
- validationContext
- ValidationContext
Doğrulama işlemiyle ilgili bağlam bilgileri.The context information about the validation operation.
Döndürülenler
ValidationResult sınıfının örneği.An instance of the ValidationResult class.
Özel durumlar
Geçerli öznitelik hatalı biçimlendirilmiş.The current attribute is malformed.
IsValid(Object, ValidationContext) Türetilmiş bir sınıf tarafından uygulanmadı.IsValid(Object, ValidationContext) has not been implemented by a derived class.