コード例 #1
0
        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));
        }
コード例 #2
0
        private CustomerDto CreateNewCustomerCommand(IRepositoryLocator locator, CustomerDto dto)
        {
            var customer = Customer.Create(locator, dto);

            locator.FlushModifications();
            //Thread.Sleep(10000);
            return(Customer_to_Dto(customer));
        }
コード例 #3
0
        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());
        }
コード例 #4
0
 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);
 }