public async Task Handle(IUserSession userIssuingCommand, CreateTest command)
 {
     var test = new TestAggregateRoot(
         Guid.NewGuid(),
         command.Name);
     await _repository.SaveChanges(test);
 }
示例#2
0
        public void Handle(RemoveProductFromCart removeProductFromCart)
        {
            var cart = _repository.Load <ShoppingCart>(removeProductFromCart.CartId);

            cart.RemoveProduct(removeProductFromCart.ProductId);

            _repository.SaveChanges(cart);
        }
        public void Handle(AddProductToCart message)
        {
            var cart = _repository.Load <ShoppingCart>(message.CartId);

            cart.AddProduct(message.ProductId);

            _repository.SaveChanges(cart);
        }
 public async Task Handle(IUserSession userIssuingCommand, AddCoolness command)
 {
     var coolness = new CoolnessIndicator(Guid.NewGuid(), command.Coolness);
     await _repository.SaveChanges(coolness);
 }