All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 1m14s
26 lines
586 B
C#
26 lines
586 B
C#
using FluentValidation;
|
|
using GameIdeas.Shared.Constants;
|
|
using GameIdeas.Shared.Dto;
|
|
|
|
namespace GameIdeas.BlazorApp.Pages.Games.Components;
|
|
|
|
public class GameValidation : AbstractValidator<GameDto>
|
|
{
|
|
public GameValidation()
|
|
{
|
|
RuleFor(g => g.Title)
|
|
.NotEmpty()
|
|
.NotNull()
|
|
.Matches(GlobalConstants.RegexName);
|
|
|
|
RuleFor(g => g.ReleaseDate)
|
|
.NotEmpty()
|
|
.NotNull();
|
|
|
|
RuleFor(g => g.Interest)
|
|
.NotNull()
|
|
.GreaterThanOrEqualTo(1)
|
|
.LessThanOrEqualTo(5);
|
|
}
|
|
}
|