ValidatingWithDataAnnotationsDemo/Models/PersonModel.cs
/// <summary>
/// Determines if the current object is valid
/// </summary>
/// <returns>Returns True if valid, false if it is not</returns>
Determines if the current object is valid
Determines if the current object is valid
public bool IsValid()
        {
            bool result = true;
            foreach(var s in ValidatedFields)
            {
                if (!string.IsNullOrEmpty(OnValidate(s)))
                {
                    result = false;
                    break;
                }
            }
            return result;
        }
public bool IsValid ( ) { bool result = true ; foreach ( var s in ValidatedFields ) { if ( ! string . IsNullOrEmpty ( OnValidate ( s ) ) ) { result = false ; break ; } } return result ; }
Determines if the current object is valid
Determines if the current object is valid
Returns True if valid, false if it is not
Returns True if valid false if it is not