validators
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using FluentValidation;
|
||||
using WebApi.DataTransferObjects.Tracks;
|
||||
|
||||
namespace WebApi.Validators.Tracks;
|
||||
|
||||
public sealed class CreateTrackRequestValidator : AbstractValidator<CreateTrackRequest>
|
||||
{
|
||||
public CreateTrackRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.Title)
|
||||
.NotEmpty()
|
||||
.MaximumLength(50);
|
||||
|
||||
RuleFor(x => x.PictureIntentId)
|
||||
.NotEmpty();
|
||||
|
||||
RuleFor(x => x.AudioIntentId)
|
||||
.NotEmpty();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user