public override int GetHashCode()
 {
     unchecked
     {
         return(((AllowedTemplates != null ? AllowedTemplates.GetHashCode() : 0) * 397) ^ (DefaultTemplate != null ? DefaultTemplate.GetHashCode() : 0));
     }
 }
        /// <summary>
        /// Custom validation
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public override IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (AllowedTemplates?.Any(x => x.IsNullOrWhiteSpace()) ?? false)
            {
                yield return(new ValidationResult("Template value cannot be null", new[] { "AllowedTemplates" }));
            }

            foreach (var v in base.Validate(validationContext))
            {
                yield return(v);
            }
        }
 protected bool Equals(DocumentTypeInfo other)
 {
     return(AllowedTemplates.NullableSequenceEqual(AllowedTemplates) && string.Equals(DefaultTemplate, other.DefaultTemplate));
 }