Class DataAnnotationsValidator
Class that represents a helper for dana annotations validator.
Inheritance
Inherited Members
Namespace: Fibula.Common.Utilities
Assembly: Fibula.Common.Utilities.dll
Syntax
public static class DataAnnotationsValidator
Methods
| Improve this Doc View SourceTryValidateObject(Object, out IList<ValidationResult>, IDictionary<Object, Object>)
Performs validation on an object and all of it's primitive properties.
Declaration
public static bool TryValidateObject(object obj, out IList<ValidationResult> results, IDictionary<object, object> validationContextItems = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to validate. |
System.Collections.Generic.IList<System.ComponentModel.DataAnnotations.ValidationResult> | results | The results of the validation. |
System.Collections.Generic.IDictionary<System.Object, System.Object> | validationContextItems | Auxiliary items to initialize validation context with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the validation passes, false otherwise. |
TryValidateObjectRecursive<T>(T, out IList<ValidationResult>, IDictionary<Object, Object>)
Performs validation on an object and all of it's properties, recursing into any non-primitive properties.
Declaration
public static bool TryValidateObjectRecursive<T>(T obj, out IList<ValidationResult> results, IDictionary<object, object> validationContextItems = null)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to validate. |
System.Collections.Generic.IList<System.ComponentModel.DataAnnotations.ValidationResult> | results | The results of the validation. |
System.Collections.Generic.IDictionary<System.Object, System.Object> | validationContextItems | Auxiliary items to initialize validation context with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the validation passes, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | The type of object. |
ValidateObjectRecursive<T>(T, IDictionary<Object, Object>)
Performs validation on an object and all of it's properties, recursing into any non-primitive properties.
Declaration
public static void ValidateObjectRecursive<T>(T obj, IDictionary<object, object> validationContextItems = null)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to validate. |
System.Collections.Generic.IDictionary<System.Object, System.Object> | validationContextItems | Auxiliary items to initialize validation context with. |
Type Parameters
Name | Description |
---|---|
T | The type of object. |