added validators in project
This commit is contained in:
15
BookHive/Validators/Loans/PatchLoanDtoValidator.cs
Normal file
15
BookHive/Validators/Loans/PatchLoanDtoValidator.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using BookHive.Endpoints.Loans;
|
||||
using FastEndpoints;
|
||||
using FluentValidation;
|
||||
|
||||
namespace BookHive.Validators.Loans;
|
||||
|
||||
public class PatchLoanDtoValidator : Validator<PatchReturnLoanRequest>
|
||||
{
|
||||
public PatchLoanDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Id)
|
||||
.GreaterThan(0)
|
||||
.WithMessage("Id is invalid");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user