Using Autofac Aggregate Services

September 13, 2016

I really like using Autofac, it’s one of the most productive libraries I know, and it’s so much fun to discover new features. Aggregate Services is Autofac feature that allows you to wrap a set of dependencies into a single aggregate without the need to implement a concrete type for it. Consider the following case where you have a base class that has dependencies on a few other services, and two derived classes: class BaseLicenseGenerator:ILicenseGenerator { //members public BaseLicenseGenerator(ILogger logger, IUserRepository userRepository, ILicenseRepository licenseRepository) { ...
no comments