ValidationHelper.TryValidate Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Overloads

TryValidate(IValidatableObject, ICollectionResult>) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.
TryValidate(object, ICollectionResult>) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.

TryValidate(IValidatableObject, ICollectionResult>)

Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.

public static bool TryValidate(this IValidatableObject instance, ICollection<ValidationResult> result)

Parameters

instance
System.ComponentModel.DataAnnotations.IValidatableObject

The object to validate.

result
System.Collections.Generic.ICollection

A collection to hold each failed validation.

Returns

bool

TryValidate(object, ICollectionResult>)

Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.

public static bool TryValidate(object instance, ICollection<ValidationResult> result)

Parameters

instance
object

The object to validate.

result
System.Collections.Generic.ICollection

A collection to hold each failed validation.

Returns

bool