I have a service class with the following ctor:
public class (IMessageService emailService, IMessageService smsService)
{ ... }
and two impleme
//First just write below lines in IOC
this.For().Use();
this.For().Use();
//Then We can directly use it in our constructor injection of our class
//Where we need it
IEnumerable messageServices;
public ClassNeedsInjection(IEnumerable messageServices)
{
this.messageServices=messageServices;
foreach (var messageService in this.messageServices)
{
//use both the objects as you wish
}
}