2021-12-29 23:46:52 +01:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Validator
|
|
|
|
{
|
2022-07-21 02:03:11 +02:00
|
|
|
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
|
|
|
|
public class RequiredAttribute : Attribute
|
|
|
|
{
|
|
|
|
public WarningType WarningType { get; private set; } = WarningType.Error;
|
2021-12-29 23:46:52 +01:00
|
|
|
public string Category { get; private set; } = ReportCategories.Design;
|
|
|
|
|
|
|
|
public RequiredAttribute() { }
|
|
|
|
|
|
|
|
public RequiredAttribute(WarningType warningType = WarningType.Error, string category = ReportCategories.Design)
|
|
|
|
{
|
|
|
|
WarningType = warningType;
|
|
|
|
Category = category;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|