using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace WIDESEAWCS_Core.Attributes
|
{
|
[AttributeUsage(AttributeTargets.Property)]
|
public class PropertyValidateAttribute : Attribute
|
{
|
public int MaxValue { get; set; } = int.MaxValue;
|
|
public int MinValue { get; set; } = int.MinValue;
|
|
public bool NotNullAndEmpty { get; set; } = true;
|
|
public bool IsContainMaxValue { get; set; } = false;
|
|
public bool IsContainMinValue { get; set; } = false;
|
|
public string Description { get; set; }
|
|
public PropertyValidateAttribute(string description)
|
{
|
if (!string.IsNullOrEmpty(description))
|
Description = description;
|
}
|
}
|
|
[AttributeUsage(AttributeTargets.Class)]
|
public class ModelValidateAttribute : Attribute
|
{
|
public ModelValidateType ModelValidateType { get; } = ModelValidateType.SimpleValidate;
|
|
public ModelValidateAttribute()
|
{
|
}
|
}
|
|
public enum ModelValidateType
|
{
|
SimpleValidate,
|
CustomValidate,
|
SimpleAndCustom
|
}
|
}
|