17 lines
367 B
C#
17 lines
367 B
C#
|
using Cloud.Enums;
|
|||
|
using Cloud.Requests;
|
|||
|
using FluentValidation;
|
|||
|
|
|||
|
namespace Cloud.Validation
|
|||
|
{
|
|||
|
public class ValveValidator : AbstractValidator<ValveRequest>
|
|||
|
{
|
|||
|
public ValveValidator() {
|
|||
|
|
|||
|
RuleFor(request => request.Action)
|
|||
|
.NotEmpty().WithMessage("Action can't be empty").
|
|||
|
IsEnumName(typeof (ValveEnum)).WithMessage("Action is not correct");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|