using System.ComponentModel.DataAnnotations; namespace VideoGameQuotes.Web.Validation { public class NonEmptyText : ValidationAttribute { public override bool IsValid(object value) { if (value == null) { return false; } return !string.IsNullOrWhiteSpace(value.ToString()); } } }