using FluentValidation; using GameIdeas.Shared.Constants; using GameIdeas.Shared.Dto; namespace GameIdeas.BlazorApp.Pages.Games.Components; public class GameValidation : AbstractValidator { 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); } }