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)); }
public void CreateCustomerGroup(CustomerGroupDto customerGroupDto) { customerGroupRepository.Add(customerGroupDto.MappingGroup()); }