using System;
using System.Collections.Generic;
using System.Text;
namespace Appointment.Entity.ValidateAttribute
{
///
/// 必填项
///
///
/// Add:yuangb 2019-3-11
/// [StringRequired(ErrorMessage ="状态不能为空")]
///
public class StringRequiredAttribute : ValidateAttribute
{
///
/// 报错提示信息
///
public string ErrorMessage { get; set; }
public override string Validate(object oValue)
{
if (oValue == null || string.IsNullOrWhiteSpace(oValue.ToString()))
{
return ErrorMessage;
}
else
{
return null;
}
}
}
}