コード例 #1
0
ファイル: Program.cs プロジェクト: si-griffiths/cqrs-testbed
        static void Main(string[] args)
        {
            var bootStrapper = new Bootstrapper();
            var commandService = bootStrapper.Boot();

            var createCustomerCommand = new CreateCustomerCommand()
            {
                CustomerId = Guid.NewGuid(),
                Email = "*****@*****.**",
                FirstName = "Simon",
                LastName = "Griffiths"
            };
            commandService.ExecuteCommand(createCustomerCommand);
        }
コード例 #2
0
ファイル: Customer.cs プロジェクト: si-griffiths/cqrs-testbed
 public Customer(CreateCustomerCommand command)
 {
     var customerCreatedEvent = new CustomerCreatedEvent(command.CustomerId, command.FirstName, command.LastName, command.Email);
     RaiseEvent(customerCreatedEvent);
 }