private DispatchNoteModel SaveDispatchImpl(IRepositoryLocator locator, DispatchNoteModel dispatchModel) { var entity = DispatchNote.Create(locator, dispatchModel); locator.FlushModifications(); // need to flush in order to get the Id into the DTO return(Mapper.Map <DispatchNote, DispatchNoteModel>(entity)); }
private CustomerDto CreateNewCustomerCommand(IRepositoryLocator locator, CustomerDto dto) { var customer = Customer.Create(locator, dto); locator.FlushModifications(); //Thread.Sleep(10000); return(Customer_to_Dto(customer)); }
private DtoResponse CreateCustomer(IRepositoryLocator locator) { var customer = Customer.Create(locator, new CustomerDto { FirstName = "TestName", LastName = "TestLastName", Telephone = "999-0000" }); customer.AddAddress(locator, new AddressDto { City = "TestCity", Country = "TestCountry", PostCode = "22", Street = "TestStreet" }); Assert.AreEqual(0, customer.Id); locator.FlushModifications(); Assert.AreNotEqual(0, customer.Id); return(new DtoResponse()); }
private DispatchNoteModel SaveDispatchImpl(IRepositoryLocator locator, DispatchNoteModel dispatchModel) { var entity = DispatchNote.Create(locator, dispatchModel); locator.FlushModifications(); // need to flush in order to get the Id into the DTO return Mapper.Map<DispatchNote, DispatchNoteModel>(entity); }