Skip to content

Instantly share code, notes, and snippets.

@sskset
Created September 3, 2019 12:59
Show Gist options
  • Save sskset/da699b053c5033c028b278042b3ba702 to your computer and use it in GitHub Desktop.
Save sskset/da699b053c5033c028b278042b3ba702 to your computer and use it in GitHub Desktop.
FluentValidation in Startup.cs
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services
.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
.AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining<Startup>());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment