예제 #1
0
 public TaskController(ICommandBus commandBus, IMappingEngine mappingEngine, IIdentity identity, IViewModelData viewModelData)
 {
     _commandBus = commandBus;
     _mappingEngine = mappingEngine;
     _identity = identity;
     _viewModelData = viewModelData;
 }
예제 #2
0
 public ExpenseController(ICommandBus commandBus, IMappingEngine mapper, ICategoryRepository categoryRepository, IExpenseRepository expenseRepository)
 {
     this.commandBus = commandBus;
     this.mapper = mapper;
     this.categoryRepository = categoryRepository;
     this.expenseRepository = expenseRepository;
 }
 public BookingApplicationService(
     ICommandBus commandBus,
     IRoutingService routingService)
 {
     _commandBus = commandBus;
     _routingService = routingService;
 }
예제 #4
0
파일: TestBase.cs 프로젝트: sahina/aec_cqrs
        public void Setup()
        {
            //
            // observers

            SystemObserver.Setup(new IObserver<ISystemEvent>[] { new ConsoleObserver() });

            //
            // message router

            Router = new MemoryMessageRouter();

            Router.RegisterHandler<CreateAccount>(new CreateAccountHandler().Handle);
            Router.RegisterHandler<AccountCreated>(new AccountCreatedHandler().Handle);

            //
            // message bus

            var bus = new NullBus();
            CommandBus = bus;
            EventBus = bus;

            //
            // Queue Writer

            var queueWriter = new QueueWriterToBus(bus);

            //
            // Misc
            Sender = new MessageSender(new IQueueWriter[] { queueWriter });
            Identifier = new AccountID(Guid.NewGuid());
        }
예제 #5
0
 public PokerServer(ICommandBus cmdBus, ITableProjection tableProjection, IPlayerConnectionMap playerConnectionMap, IClientChannel clientChannel)
 {
     _cmdBus = cmdBus;
     _tables = tableProjection;
     _playerConnectionMap = playerConnectionMap;
     _clientChannel = clientChannel;
 }
예제 #6
0
 public FoodExperienceController(ICommandBus bus, IExperiencesQueryService experiencesQueryService)
 {
     if (bus == null) throw new ArgumentNullException("bus");
     if (experiencesQueryService == null) throw new ArgumentNullException("experiencesQueryService");
     _bus = bus;
     _experiencesQueryService = experiencesQueryService;
 }
예제 #7
0
 public PostController(ViewManager viewManager, IAuthenticationService authenticationService, ICommandBus commandBus)
     : base(commandBus)
 {
     _postView = viewManager.GetView<IPostView>();
     _blogView = viewManager.GetView<IBlogView>();
     _authenticationService = authenticationService;
 }
예제 #8
0
 public ProductController(IReadModelProductDao dao, ICommandBus bus)
 {
     if (dao == null) throw new ArgumentNullException(nameof(dao));
     if (bus == null) throw new ArgumentNullException(nameof(bus));
     _dao = dao;
     _bus = bus;
 }
예제 #9
0
        private void Run()
        {
            runtime = new SampleRunTime(CONNECTION_STRING);
            runtime.Start();

            // Configure dependencies
            System.Data.Entity.Database.SetInitializer<SqlBankContext>(new System.Data.Entity.DropCreateDatabaseIfModelChanges<SqlBankContext>());
            var db = new SqlBankContext(CONNECTION_STRING);
            runtime.ServiceLocator.Register(db);

            // Get the Command Bus
            commandBus = runtime.ServiceLocator.Resolve<ICommandBus>();
            // Create and send a couple of command
            var accountReportReadModel = runtime.ServiceLocator.Resolve<AccountReportReadService>();
            var accounts = accountReportReadModel.GetAccounts();
            if (accounts.Count() == 0)
            {
                Console.WriteLine("Adding initial data...\n\n\n");
                var cmdMarcus = new CreateAccountCommand { FirstName = "Marcus", LastName = "Hammarberg" };
                var cmdDarren = new CreateAccountCommand { FirstName = "Darren", LastName = "Cauthon" };
                var cmdTyrone = new CreateAccountCommand { FirstName = "Tyrone", LastName = "Groves" };
                commandBus.Send(cmdMarcus);
                commandBus.Send(cmdDarren);
                commandBus.Send(cmdTyrone);
            }

            ProcessMenu();

            runtime.Shutdown();

            Console.ReadLine();
        }
        public ContentTreeNodeController(IContentTreePageNodeContext contentTreePageNodeContext, 
											IContentTreeNodeToContentTreeNodeInputModelMapper contentTreeNodeToContentTreeNodeInputModelMapper,
            ITreeNodeRepository treeNodeRepository, 
											IContentTreeNodeProviderContext contentTreeNodeProviderContext,  
											IContentTreeNodeDisplayViewModelBuilder contentTreeNodeDisplayViewModelBuilder, 
											IRawUrlGetter rawUrlGetter,
											ICommandBus commandBus,
											IGuidGetter guidGetter,
											IContentTreeNodeFileUploadPersister contentTreeNodeFileUploadPersister,
                                            ICurrentUserContext currentUserContext,
                                            ITreeNodeIdToUrl treeNodeIdToUrl,
                                            IGetUrlOfFrontSideWebsite getUrlOfFrontSideWebsite,
                                            IContentTree contentTree,
                                            IContentTreeNodeMetaInformationViewModelBuilder contentTreeNodeMetaInformationViewModelBuilder)
        {
            CurrentUserContext = currentUserContext;
            this.contentTreeNodeMetaInformationViewModelBuilder = contentTreeNodeMetaInformationViewModelBuilder;
            this.contentTree = contentTree;
            this.getUrlOfFrontSideWebsite = getUrlOfFrontSideWebsite;
            this.treeNodeIdToUrl = treeNodeIdToUrl;
            this.currentUserContext = currentUserContext;
            this.contentTreeNodeFileUploadPersister = contentTreeNodeFileUploadPersister;
            this.guidGetter = guidGetter;
            this.commandBus = commandBus;
            this.contentTreeNodeProviderContext = contentTreeNodeProviderContext;
            this.treeNodeRepository = treeNodeRepository;
            this.contentTreeNodeToContentTreeNodeInputModelMapper = contentTreeNodeToContentTreeNodeInputModelMapper;
            this.contentTreePageNodeContext = contentTreePageNodeContext;
        }
예제 #11
0
 public AccountController(ICommandBus commandBus, IUserRepository userRepository,
                          IFormsAuthentication formAuthentication)
 {
     this.commandBus = commandBus;
     this.userRepository = userRepository;
     this.formAuthentication = formAuthentication;
 }
예제 #12
0
 public FactController(
     ICommandBus commandBus,
     IReadStore readStore)
 {
     _commandBus = commandBus;
     _readStore = readStore;
 }
예제 #13
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext,
     IPostDao postDao,
     IVoteDao voteDao,
     ICommentDao commentDao,
     IPermissionDao permissionDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     IPostWrapper postWrapper,
     ISubWrapper subWrapper,
     ICommentWrapper commentWrapper)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
     _postDao = postDao;
     _voteDao = voteDao;
     _commentDao = commentDao;
     _permissionDao = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _postWrapper = postWrapper;
     _subWrapper = subWrapper;
     _commentWrapper = commentWrapper;
 }
        public void Setup()
        {
            _commandBus = MockRepository.GenerateMock<ICommandBus>();
            _messageManager = MockRepository.GenerateMock<IMessageManager>();

            _commandExecutor = new CommandExecutor( _commandBus, _messageManager );
        }
        public given_controller()
        {
            this.bus = Mock.Of<ICommandBus>();
            this.conferenceDao = Mock.Of<IConferenceDao>(x => x.GetConferenceAlias(conferenceAlias.Code) == conferenceAlias);
            this.orderDao = Mock.Of<IOrderDao>();

            this.routes = new RouteCollection();

            this.routeData = new RouteData();
            this.routeData.Values.Add("conferenceCode", conferenceAlias.Code);

            var requestMock = new Mock<HttpRequestBase>(MockBehavior.Strict);
            requestMock.SetupGet(x => x.ApplicationPath).Returns("/");
            requestMock.SetupGet(x => x.Url).Returns(new Uri("http://localhost/request", UriKind.Absolute));
            requestMock.SetupGet(x => x.ServerVariables).Returns(new NameValueCollection());

            var responseMock = new Mock<HttpResponseBase>(MockBehavior.Strict);
            responseMock.Setup(x => x.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(s => s);

            var context = Mock.Of<HttpContextBase>(c => c.Request == requestMock.Object && c.Response == responseMock.Object);

            this.sut = new RegistrationController(this.bus, this.orderDao, this.conferenceDao);
            this.sut.ConferenceAlias = conferenceAlias;
            this.sut.ConferenceCode = conferenceAlias.Code;
            this.sut.ControllerContext = new ControllerContext(context, this.routeData, this.sut);
            this.sut.Url = new UrlHelper(new RequestContext(context, this.routeData), this.routes);
        }
예제 #16
0
 public QuestionsController(ICommandBus commandBus,
     IQuestionManager questionManager)
 {
     _commandBus = commandBus;
     _questionManager = questionManager;
     _questionMapper = new QuestionToQuestionMapper();
 }
 public CreateNewGameController(IPlayerAuthenticator player_authenticator, 
                                IQueryService query_service,
                                ICommandBus command_bus)
 {
     _player_authenticator = player_authenticator;                                    
     _command_bus = command_bus;
 }
예제 #18
0
 public ControllerBase(ICommandBus commandBus, 
                       IMenuRepository menuRepository,
                       IPartRepository partRepository)
 {
     CommandBus = commandBus;
     MenuRepository = menuRepository;
     PartRepository = partRepository;
 }
        public MenuListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus)
            : base(viewModelResolver)
        {
            _viewProvider = viewProvider;
            _commandBus = commandBus;

            Elements = new BindableCollection<MenuItemView>();
        }
예제 #20
0
        public AccountController(ICommandBus commandBus, RedisReadClient redisReadClient)
        {
            this.commandBus = commandBus;
            this.redisReadClient = redisReadClient;

            this.UserDevicePrefixNamespace = "UserDevice";
            this.RefreshTokenPrefixNamespace = "Ticket";
        }
 public CashInController(IPlayerAuthenticator player_authenticator, 
                         ICommandBus command_bus,
                         IQueryService query_service)
 {
     _player_authenticator = player_authenticator;
     _command_bus = command_bus;
     _query_service = query_service;
 }
예제 #22
0
 public RefreshTokenProvider(IRefreshTokenService refreshTokenService, ICommandBus commandBus, int refreshTokenExpiredTimeInMinutes, int ttlChange)
 {
     this.refreshTokenService = refreshTokenService;
     this.commandBus = commandBus;
     this.expriredTime = refreshTokenExpiredTimeInMinutes;
     this.ttlChange = ttlChange;
     this.serializer = new TicketSerializer();
 }
 public AccountRegisterController(ILocalAuthenticationService authentication_service,
                                  ICommandBus command_bus,
                                  IFormsAuthentication forms_authentication)
 {
     _authentication_service = authentication_service;
     _command_bus = command_bus;
     _forms_authentication = forms_authentication;
 }
        public AddWaiterViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus)
            : base(viewModelResolver)
        {
            if (commandBus == null)
                throw new ArgumentNullException("commandBus");

            _commandBus = commandBus;
        }
        public AddMenuItemViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus)
            : base(viewModelResolver)
        {
            _viewProvider = viewProvider;
            _commandBus = commandBus;

            Categories = new BindableCollection<CategoryView>();
        }
예제 #26
0
 static async void Seed(ICommandBus bus)
 {
     while (true)
     {
         await bus.SendAsync(new LabCommand());
         await Task.Delay(3000);
     }
 }
 public AuthorizationServerProvider(IUserService userService, IAdminUserService adminUserService,
     IAppService appService, ICommandBus commandBus)
 {
     this.userService = userService;
     this.adminUserService = adminUserService;
     this.appService = appService;
     this.commandBus = commandBus;
 }
 public ContentTreeCacheImplementation(ITreeNodeRepository treeNodeRepository, 
     IContentTreeNodeProviderContext contentTreeNodeProviderContext,
     ICommandBus commandBus,
     IGuidGetter guidGetter,
     IGetPathToDataDirectoryService getPathToDataDirectoryService)
     : base(treeNodeRepository, contentTreeNodeProviderContext, commandBus, guidGetter)
 {
     this.getPathToDataDirectoryService = getPathToDataDirectoryService;
 }
예제 #29
0
 public AccountController(IMappingEngine mapper, ICommandBus commandBus, IUserRepository userRepository, ApplicationUserManager<PointNetUser, int> userManager
     , ILogger logger)
 {
     this._commandBus = commandBus;
     this._userRepository = userRepository;
     this._userManager = userManager;
     _logger = logger;
     _mapper = mapper;
 }
        public with_a_BetController()
        {
            player_authenticator = MockRepository.GenerateStub<IPlayerAuthenticator>();
            command_bus = MockRepository.GenerateStub<ICommandBus>();
            query_service = MockRepository.GenerateStub<IQueryService>();
            bet_command_mapper = MockRepository.GenerateStub<ICommandMapper<BetCommand, BetView>>();

            SUT = new BetController(player_authenticator, command_bus, query_service, bet_command_mapper);
        }
예제 #31
0
 public ICommandBusMiddleware <TCommand>[] CreateMiddlewares <TCommand>(ICommandBus commandBus)
     where TCommand : class, ICommandBase
 {
     return(serviceLocator.GetAll <ICommandBusMiddleware <TCommand> >()
            .ToArray());
 }
예제 #32
0
 public ThingyController(
     ICommandBus commandBus)
 {
     _commandBus = commandBus;
 }
 public CustomersController(ICommandBus commandBus)
 {
     _commandBus = commandBus;
 }
예제 #34
0
 public CommentsController(ICommandBus commandBus, IGrainFactory grainFactory)
     : base(commandBus)
 {
     this.grainFactory = grainFactory;
 }
예제 #35
0
 public HistoryController(ICommandBus commandBus, IHistoryEventRepository historyEventRepository)
     : base(commandBus)
 {
     this.historyEventRepository = historyEventRepository;
 }
예제 #36
0
 public AppsController(ICommandBus commandBus, IAppRepository appRepository) 
     : base(commandBus)
 {
     this.appRepository = appRepository;
 }
예제 #37
0
 public AddPatterns(InitialPatterns initialPatterns, ICommandBus commandBus, IAppsIndex indexForApps)
 {
     this.indexForApps    = indexForApps;
     this.initialPatterns = initialPatterns;
     this.commandBus      = commandBus;
 }
예제 #38
0
 public ItemsController(ICommandBus bus)
 {
     Bus = bus;
 }
예제 #39
0
 public DictionaryController(ICommandBus commandBus, IQueryBus queryBus)
 {
     _commandBus = commandBus;
     _queryBus   = queryBus;
 }
예제 #40
0
 public TariffsService(ITariffDao dao, ICommandBus commandBus)
 {
     _commandBus = commandBus;
     _dao        = dao;
 }
예제 #41
0
 public CameraService(ILogger logger, ICommandBus bus, ICameraConfiguration cameraConfiguration)
 {
     _logger = logger;
     _bus    = bus;
     _cameraConfiguration = cameraConfiguration;
 }
예제 #42
0
 public OrdersController(ICommandBus bus)
 {
     this.bus = bus;
 }
 public AccountsController(ICommandBus commandBus, IQueryBus queryBus)
 {
     _commandBus = commandBus;
     _queryBus   = queryBus;
 }
 public TransactionsController(ICommandBus commandBus, IQueryBus queryBus)
 {
     this.commandBus = commandBus;
     this.queryBus   = queryBus;
 }
 public ActiveProductController(ICommandBus bus) : base(bus)
 {
 }
예제 #46
0
 public LanguagesController(ICommandBus commandBus)
     : base(commandBus)
 {
 }
예제 #47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseController"/> class.
 /// </summary>
 /// <param name="commandBus">The command bus.</param>
 /// <param name="queryProcessor">The query processor.</param>
 public BaseController(ICommandBus commandBus,
                       IQueryProcessor queryProcessor)
 {
     CommandBus     = commandBus;
     QueryProcessor = queryProcessor;
 }
예제 #48
0
 public AppRolesController(ICommandBus commandBus, RolePermissionsProvider permissionsProvider)
     : base(commandBus)
 {
     this.permissionsProvider = permissionsProvider;
 }
예제 #49
0
 public ManufactureController(ICommandBus commandBus, IManufactureQueries queries)
 {
     _commandBus = commandBus;
     _queries    = queries;
 }
예제 #50
0
 public ExecuteCommandJobHandler(ICommandBus commandBus)
 {
     this.commandBus = commandBus;
 }
 public ConferenceViewModelGenerator(ICommandBus bus)
 {
     this.bus             = bus;
     conferenceRepository = new ConferenceMongoRepository <ConferenceView>();
     seatTypeRepository   = new ConferenceMongoRepository <SeatTypeView>();
 }
예제 #52
0
 public static void Configure(ICommandBus commandBus, IBlogPostRepository blogPostRepository, IPageRepository pageRepository, IFileRepository fileRepository)
 {
     RegisterCommandHandlers(commandBus, blogPostRepository, pageRepository, fileRepository);
 }
예제 #53
0
 public SchemaFieldsController(ICommandBus commandBus)
     : base(commandBus)
 {
 }
예제 #54
0
 public UserManagementController(ICommandBus commandBus, IUserService userService)
     : base(commandBus)
 {
     this.userService = userService;
 }
예제 #55
0
        //private readonly IBaseCommandHandler<CreateUserCommand> handler;

        //public UserController(IBaseCommandHandler<CreateUserCommand> handler)
        //{
        //    this.handler = handler;
        //}


        public UserController(ICommandBus commandBus, IUserQueryFacade userQueryFacade)
        {
            _commandBus      = commandBus;
            _userQueryFacade = userQueryFacade;
        }
 public WithResponseController(ICommandBus bus)
 {
     _bus = bus;
 }
예제 #57
0
 public RegistrationProcessHardeningIntegrationSteps()
 {
     commandBus = ConferenceHelper.BuildCommandBus();
     eventBus   = ConferenceHelper.BuildEventBus();
 }
예제 #58
0
 protected ApiControllerBase(ICommandBus bus)
 {
     Bus = bus;
 }
예제 #59
0
 public RefreshTokenCommandHandler(IConfiguration configuration, IQueryBus queryBus, ICommandBus commandBus, UserManager <AspNetUser> userManager,
                                   TokenValidationParameters tokenValidationParams)
 {
     _configuration         = configuration;
     _queryBus              = queryBus;
     _commandBus            = commandBus;
     _userManager           = userManager;
     _tokenValidationParams = tokenValidationParams;
 }
예제 #60
0
 public IssuesController(IQueryBus queryBus,
                         ICommandBus commandBus)
 {
     this.queryBus   = queryBus ?? throw new ArgumentException(nameof(queryBus));
     this.commandBus = commandBus ?? throw new ArgumentException(nameof(commandBus));
 }