internal void IdFactoryTest(List <CustomerToCreateDto> customersToCreate) { foreach (var customerToCreate in customersToCreate) { customerToCreate.Id = idFactory.Create(); repo.Save(new Customer(customerToCreate)); } }
public void Create(IEnumerable <CustomerDTO> customers) { foreach (var currentCustomer in customers) { Customer newCustomer = new Customer(currentCustomer.FirstName, currentCustomer.LastName); newCustomer.Id = _idFactory.Create(); _repositry.Save(newCustomer); } }
public void Create(IEnumerable <CustomerToCreateDto> customersToCreate) { foreach (var customerToCreateDto in customersToCreate) { var customer = new Customer(customerToCreateDto.FirstName, customerToCreateDto.LastName); customer.Id = _idFactory.Create(); _customerRepository.Save(customer); } }
public void Create(IEnumerable <CustomerDTO> customerDTOs) { foreach (var item in customerDTOs) { Customer newCustomer = new Customer(item.FirstName, item.LastName); newCustomer.Id = idFactory.Create(); customerRepository.Save(newCustomer); } }
/// <summary> /// We need to verify that save is called /// </summary> /// <param name="customercommand"></param> public void Create(IEnumerable <CustomerCreateCommand> customercommandsList) { foreach (var customercommand in customercommandsList) { Customer customer = new Customer(customercommand.FirstName, customercommand.LastName); // We need different Ids from create method... customer.Id = _idFactory.Create(); _customerRepository.Save(customer); } }
private void AddJourney() { var journeyId = _idFactory.Create(); try { var lifts = Lifts.Select(lift => lift.ToDto()); _commandDispatcher.Dispatch(new AddJourneyWithLiftsCommand(journeyId, RouteDistance, DateOfOccurrence, lifts)); _eventBus.Publish(new JourneyWithLiftsAddedEvent(journeyId)); Notification.Replace(new SuccessNotification("Added successfuly.")); } catch (Exception e) { Notification.Replace(new ErrorNotification(e.Message)); } }