Add validation and gateway creation
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 1m14s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 1m14s
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user