I’m relatively new to .net core and there’s one thing that bothers me. In most of extensions e.g Mongo, there are multiple registration of types which are resolved in further ones. Could someone explain to me what is the benefit of such approach? I mean why not just register only one dependency (like mongo client) and there load all objects from configuration?
var configuration = context.Resolve < IConfiguration >();
var options = configuration.GetOptions(“mongo”);
var options = context.Resolve < MongoDbOptions>();
return new MongoClient(options.ConnectionString);
Why do you use Autofac in most of cases instead of built-in .net core DI ?
Thanks for answers