Catel.Data.ValidationContext.GetValidations C# (CSharp) Méthode

GetValidations() public méthode

Gets all the field and business rule validations.
public GetValidations ( ) : List
Résultat List
        public List<IValidationResult> GetValidations()
        {
            var list = new List<IValidationResult>();

            lock (_fieldValidations)
            {
                list.AddRange(from validation in _fieldValidations
                              select validation as IValidationResult);
            }

            lock (_businessRuleValidations)
            {
                list.AddRange(from validation in _businessRuleValidations
                              select validation as IValidationResult);
            }

            return list;
        }

Same methods

ValidationContext::GetValidations ( object tag ) : List

Usage Example

            public void ReturnsRightValidationsForEmptyContextWithTag()
            {
                var context = new ValidationContext();

                var validations = context.GetValidations("tag");
                Assert.AreEqual(0, validations.Count);
            }