using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace Infrastructure.Application { public class BaseRequest { [ScaffoldColumn(false)] public List ValidationResults { get; private set; } = new List(); public bool IsValid() { var validationResults = new List(); if (!Validator.TryValidateObject(this, new ValidationContext(this, null, null), this.ValidationResults, true)) { return false; } return true; } } }