I would like to create a container where it will allow ISomeService, but not ISomeOtherService. Although my registration for ISomeService is dependent on ISomeOtherService.
It makes sense?
public interface ISomeService {}
public interface ISomeOtherService {}
public class SomeService : ISomeService
{
public SomeService(ISomeOtherService someOtherService) {}
}
public class SomeOtherService : ISomeOtherService {}
this container that I would like to allow SomeService for ISomeService, but if I tried to enable ISomeOtherService or SomeOtherService, it would fail.
Is this a bad design?
So, a little context ... I have ASP.Net MVC Controllers that will be developed by various developers. These controllers MUST have access to application services, such as ISomeService, but not to their dependencies. I would like you to not have to review all these services so that developers do not violate the design of the architecture. They should be able to get links to ISomeService, but ISomeOtherService is the database repository, and they should never deal with it directly, but ISomeService really needs this link.
( ASP.NET MVC, ), , , , , . , , ?