Ejemplo n.º 1
0
        private void RegisterUseCaseBus(IServiceCollection services)
        {
            var busBuilder = new UseCaseBusBuilder(services);

            RegisterUseCase(busBuilder);

            var usecaseBus = busBuilder.Build();

            services.AddSingleton(usecaseBus);
        }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            services.AddSingleton <IArticleRepository, ArticleRepository>();
            services.AddSingleton <IUserRepository, UserRepository>();

            var busBuilder = new UseCaseBusBuilder(services);

            busBuilder.RegisterUseCase <ArticleCreateRequest, ArticleCreateInteractor>();
            busBuilder.RegisterUseCase <ArticleGetDetailRequest, ArticleDetailGetInteractor>();
            busBuilder.RegisterUseCase <ArticleGetByAutherRequest, ArticleGetByAutherInteractor>();
            var bus = busBuilder.Build();

            services.AddSingleton(bus);
        }