Add project data
This commit is contained in:
19
Tabletop.Core/Validators/PlayerValidator.cs
Normal file
19
Tabletop.Core/Validators/PlayerValidator.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using Tabletop.Core.Models;
|
||||
|
||||
namespace Tabletop.Core.Validators
|
||||
{
|
||||
public class PlayerValidator : AbstractValidator<Player>
|
||||
{
|
||||
public PlayerValidator()
|
||||
{
|
||||
RuleFor(x => x.UsedForce)
|
||||
.LessThanOrEqualTo(x => x.AllowedForce)
|
||||
.WithMessage("Force points over limit");
|
||||
|
||||
RuleFor(x => x.Units)
|
||||
.NotEmpty()
|
||||
.WithMessage("At least one unit must be selected");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user