Add style for game creation
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 40s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 40s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using FluentValidation;
|
||||
using GameIdeas.Shared.Constants;
|
||||
using GameIdeas.Resources;
|
||||
using GameIdeas.Shared.Dto;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Pages.Games.Components;
|
||||
@@ -9,17 +9,10 @@ public class GameValidation : AbstractValidator<GameDto>
|
||||
public GameValidation()
|
||||
{
|
||||
RuleFor(g => g.Title)
|
||||
.NotEmpty()
|
||||
.NotNull()
|
||||
.Matches(GlobalConstants.RegexName);
|
||||
|
||||
RuleFor(g => g.ReleaseDate)
|
||||
.NotEmpty()
|
||||
.NotNull();
|
||||
.NotEmpty().WithMessage(ResourcesKey.InvalidTitle);
|
||||
|
||||
RuleFor(g => g.Interest)
|
||||
.NotNull()
|
||||
.GreaterThanOrEqualTo(1)
|
||||
.LessThanOrEqualTo(5);
|
||||
.GreaterThanOrEqualTo(1).WithMessage(ResourcesKey.InvalidInterest)
|
||||
.LessThanOrEqualTo(5).WithMessage(ResourcesKey.InvalidInterest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user