Dark1
❔ Form with put or delete method
I assume youre using a API for the SPA. FluentValidation (NuGet) can be used for both sides:
1. Register your validators in your services: builder.Services.AddValidatorsFromAssemblyContaining<CreateClientValidation>();
2. Now you can retrieve you validators with DI: public CreateClientHandler(CreateClientValidation validator)
3. Validate with your validator:
var validationResult = await validator.ValidateAsync(request, cancellationToken);
For deleting, you create a http request with the DELETE httpmethod and send it to the url.
Use Swagger/Postman to test your endpoints.
11 replies