public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { var services = app.ApplicationServices; ReminderService reminder = services.GetService(typeof(IReminderRequest)) as ReminderService; IReminderResponseService responseReminder = services.GetService(typeof(IReminderResponseService)) as IReminderResponseService; reminder.AddResponses(responseReminder); }
public static IServiceProvider RegisterResponsesReminder(this IServiceProvider services) { ReminderService reminder = services.GetService(typeof(IReminderRequest)) as ReminderService; //ReminderConfiguration configuration = services.GetService(typeof(ReminderConfiguration)) as ReminderConfiguration; IFactoryBroker factory = services.GetService(typeof(IFactoryBroker)) as IFactoryBroker; reminder.AddResponses( new ReminderResponseBroker(factory) ); return(services); }