Dark1
Dark1
CC#
Created by XD on 10/3/2023 in #help
❔ 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