Do we have a simple working example? #49
Unanswered
syaifulnizamyahya
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @syaifulnizamyahya, there is a small example on how to setup endpoint validation in the repo main README file. From that file: using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions;
builder.Services.AddFluentValidationAutoValidation();
var app = builder.Build();
var endpointGroup = app.MapGroup("/some-group").AddFluentValidationAutoValidation();
endpointGroup.MapPost("/", (SomeModel someModel) => $"Hello {someModel.Name}");
app.MapPost("/", (SomeOtherModel someOtherModel) => $"Hello again {someOtherModel.Name}").AddFluentValidationAutoValidation(); Could you let me know what else you need? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Title.
A simple working example would make this library easy to use.
Im working on simple endpoint. this is my usings.
Auto validation doesnt work.
but if i replace
using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions;
with
using FluentValidation.AspNetCore;
auto validation works. BUT I believe it is not using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions
This is excerpt of my code
Since autovalidation works using FluentValidation.AspNetCore, I believe all other code is ok.
Any help?
Beta Was this translation helpful? Give feedback.
All reactions