I am new learner in dependency injection and unity framework. My question scenario is that- i have interface
public interface INofifyEventDataService
{
void StatusUpdate (object objectType, JobStatus status = JobStatus.None,string messageTitle=null ,string MessageDetails=null);
}
and classes are
Public class A : INofifyEventDataService
{
void StatusUpdate (object objectType, JobStatus status = JobStatus.None,string messageTitle=null ,string MessageDetails=null)
{ //implementation form A}}
and for class B
Public class B: INofifyEventDataService
{
void StatusUpdate (object objectType, JobStatus status = JobStatus.None,string messageTitle=null ,string MessageDetails=null)
{ //implementation form B}}
and for DBLogger (assume class c)
Public class DBLogger : INofifyEventDataService
{
void StatusUpdate (object objectType, JobStatus status = JobStatus.None,string messageTitle=null ,string MessageDetails=null)
{ //implementation form DBLogger }
as far i know unity resolve it like
IUnityContainer myContainer = new UnityContainer();
myContainer.RegisterType<INofifyEventDataService, DBLogger >();
myContainer.RegisterType<INofifyEventDataService, classA>("A");
myContainer.RegisterType<INofifyEventDataService, classB>("B");
And it will resolve one by one or all like
IEnumerable<INofifyEventDataService> serviceList = myContainer.ResolveAll<INofifyEventDataService>();
and i need to enumerate all object and then call like for every object
servicelistObjectA.statusupdate(obj,status,message,title)
My requirement is to call every class StatusUpdate from single resolve object.?