public static IServiceCollection AddProcessServices(this IServiceCollection services, AppName appName) { services.AddSingleton(ProcessEngineClient.CreateExternalTaskClient()); services.AddSingleton <IProcessClient, ProcessEngineClient>(); switch (appName) { case AppName.PickingApp: services.AddSingleton <AssignTaskHandler>(); services.AddSingleton <ShiftStatusHandler>(); services.AddSingleton <DequeueTaskHandler>(); break; case AppName.IntakeApp: services.AddSingleton <FetchArticlesForNoteHandler>(); services.AddSingleton <UnfinishedArticlesBarcodesHandler>(); services.AddSingleton <MatchArticleByGtinAndBundleHandler>(); services.AddSingleton <BookStockyardLocationHandler>(); services.AddSingleton <UpdateArticleHandler>(); break; default: throw new ArgumentOutOfRangeException(nameof(appName), appName, null); } return(services); }
public static IServiceCollection AddProcessServices(this IServiceCollection services) { services.AddSingleton(ProcessEngineClient.CreateExternalTaskClient()); services.AddSingleton <IProcessClient, ProcessEngineClient>(); // external task handlers // intake services.AddSingleton <FetchArticlesForNoteHandler>(); services.AddSingleton <UnfinishedArticlesBarcodesHandler>(); services.AddSingleton <MatchArticleByGtinAndBundleHandler>(); services.AddSingleton <BookStockyardLocationHandler>(); services.AddSingleton <UpdateArticleHandler>(); // kind of identity provider services.AddSingleton <IProcessInfoProvider, ProcessInfoProvider>(); // client task related services.AddSingleton <IProcessHandlersFactory, ProcessHandlersFactory>(); services.AddTransient <ClientTaskFactory>(); services.AddTransient <IntakeClientTaskPayloadHandler>(); return(services); }