valit-stack / Valit

Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead!
MIT License
322 stars 26 forks source link

Integrating with Autofac #149

Open GooRiOn opened 6 years ago

GooRiOn commented 6 years ago

Would be cool to create an integration package for Autofac. There are lot's of thing that we could add here so hesitate to add something in the comments ;) The simplest integration would be:

containerBuilder.RegisterValit();

Calling that we would look through the assembly and register all valitators as singletons.

paw3lx commented 6 years ago

Sounds cool. I can take this one :)

GooRiOn commented 6 years ago

Nice!

dbarwikowski commented 6 years ago

Actually, we are targetting for .NET Core (right?) why don't we use built-in dependency resolver and simplify to

Configure(IServiceCollection services)
{
    services.AddValit();
}

Thanks to this, we would be able to ignore existance of all DI frameworks. Tell me if I'm wrong :)