I am trying to register a base interface IService in TinyIoc
Currently I have multiple classes that inherit from Iservice
for example AuthenticationService and RestService both inherit from base class Service which implements Iservice
The way I am doing it is like this, registering each service separately.
container.Register<IAuthenticationService, AuthenticationService>();
container.Register<IRestService, RestService>();
since they both inherit from Service : IService is there a way to register both in one call or do I have to seperately register each service?
There's a overload for the
Registermethod that accepts aFunc, that you can use to determine which concrete type do you want to return: