vgquotes/Src/VideoGameQuotes.Web/Validation/NonEmptyText.cs

13 lines
314 B
C#

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());
}
}
}