Skip to content

Instantly share code, notes, and snippets.

@Cheranga
Created August 9, 2022 09:26
Show Gist options
  • Save Cheranga/f35e9ed3455a3ddcc1fe219fafc05293 to your computer and use it in GitHub Desktop.
Save Cheranga/f35e9ed3455a3ddcc1fe219fafc05293 to your computer and use it in GitHub Desktop.
using Demo.Products.Api;
using Demo.Products.Api.Core;
using Demo.Products.Api.Core.Filters;
using Demo.Products.Api.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services
.AddControllers(options => { options.Filters.Add<ApiValidationFilter>(); })
.AddHybridModelBinder()
.RegisterValidatorsInAssembly(typeof(ModelValidatorBase<>).Assembly);
builder.RegisterApplicationServices();
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment