本文整理汇总了C#中ICommandBus类的典型用法代码示例。如果您正苦于以下问题:C# ICommandBus类的具体用法?C# ICommandBus怎么用?C# ICommandBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICommandBus类属于命名空间,在下文中一共展示了ICommandBus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BookingApplicationService
public BookingApplicationService(
ICommandBus commandBus,
IRoutingService routingService)
{
_commandBus = commandBus;
_routingService = routingService;
}
示例2: TaskController
public TaskController(ICommandBus commandBus, IMappingEngine mappingEngine, IIdentity identity, IViewModelData viewModelData)
{
_commandBus = commandBus;
_mappingEngine = mappingEngine;
_identity = identity;
_viewModelData = viewModelData;
}
示例3: FoodExperienceController
public FoodExperienceController(ICommandBus bus, IExperiencesQueryService experiencesQueryService)
{
if (bus == null) throw new ArgumentNullException("bus");
if (experiencesQueryService == null) throw new ArgumentNullException("experiencesQueryService");
_bus = bus;
_experiencesQueryService = experiencesQueryService;
}
示例4: Setup
public void Setup()
{
_commandBus = MockRepository.GenerateMock<ICommandBus>();
_messageManager = MockRepository.GenerateMock<IMessageManager>();
_commandExecutor = new CommandExecutor( _commandBus, _messageManager );
}
示例5: QuestionsController
public QuestionsController(ICommandBus commandBus,
IQuestionManager questionManager)
{
_commandBus = commandBus;
_questionManager = questionManager;
_questionMapper = new QuestionToQuestionMapper();
}
示例6: CreateNewGameController
public CreateNewGameController(IPlayerAuthenticator player_authenticator,
IQueryService query_service,
ICommandBus command_bus)
{
_player_authenticator = player_authenticator;
_command_bus = command_bus;
}
示例7: ExpenseController
public ExpenseController(ICommandBus commandBus, IMappingEngine mapper, ICategoryRepository categoryRepository, IExpenseRepository expenseRepository)
{
this.commandBus = commandBus;
this.mapper = mapper;
this.categoryRepository = categoryRepository;
this.expenseRepository = expenseRepository;
}
示例8: PokerServer
public PokerServer(ICommandBus cmdBus, ITableProjection tableProjection, IPlayerConnectionMap playerConnectionMap, IClientChannel clientChannel)
{
_cmdBus = cmdBus;
_tables = tableProjection;
_playerConnectionMap = playerConnectionMap;
_clientChannel = clientChannel;
}
示例9: given_controller
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);
}
示例10: ProductController
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;
}
示例11: Run
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();
}
示例12: FactController
public FactController(
ICommandBus commandBus,
IReadStore readStore)
{
_commandBus = commandBus;
_readStore = readStore;
}
示例13: PostController
public PostController(ViewManager viewManager, IAuthenticationService authenticationService, ICommandBus commandBus)
: base(commandBus)
{
_postView = viewManager.GetView<IPostView>();
_blogView = viewManager.GetView<IBlogView>();
_authenticationService = authenticationService;
}
示例14: SubsController
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;
}
示例15: ContentTreeNodeController
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;
}