예제 #1
0
 public Task <object> Handle(AddNewCustomerGroupCommand command, CancellationToken cancellationToken)
 {
     Entities.CustomerGroup u = new Entities.CustomerGroup(null, new Name(command.Name));
     if (!command.IsValid())
     {
         NotifyValidationErrors(command);
     }
     else
     {
         CustomerGroupModel model = _CustomerGroupRepository.Add(u);
         if (model != null)
         {
             return(Task.FromResult(model as object));
         }
         _bus.RaiseEvent(new DomainNotification("CustomerGroup", "Server error", NotificationCode.Error));
     }
     return(Task.FromResult(null as object));
 }
예제 #2
0
 public void CreateCustomerGroup(CustomerGroupDto customerGroupDto)
 {
     customerGroupRepository.Add(customerGroupDto.MappingGroup());
 }