Create API in .NET

ASP.NET automatically adds the FluentValidation in ModelValidation pipeline. After model binding in Api Controller, framework automatically resolve validator and add Model State, that’s how automatically your Dto is validated. Flow Configure ApiBehaviorOptions in services to set custom response on fluent validation fail.