You can bind the constructors :
public class ProductsController : BaseController { public ProductsController( IService<Account> productService) : base(productService) { _product = productService; } }
Note that the chained BaseController
(using base
) is passed the productService
parameter, it could be anything.
Update:
You can do the following (injection of addictions of poor men):
public class ProductsController : BaseController { public ProductsController( IService<Account> productService) : base(new SequenceService()) { _product = productService; } }
Or, go into the ISequenceService
through your inheriting types:
public class ProductsController : BaseController { public ProductsController( IService<Account> productService, ISequenceService sequenceService) : base(sequenceService) { _product = productService; } }
Odded
source share