1
0
mirror of https://github.com/maxartz15/Validator.git synced 2024-11-15 09:05:36 +01:00
Validator/Runtime/Validators/Attributes/RequiredAttribute.cs

19 lines
548 B
C#
Raw Normal View History

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