public ReturnOfferDTO SaveNewReturnOffer(ReturnOfferDTO returnOfferDTO) { var newReturnOffer = Mapper.Map<ReturnOffer>(returnOfferDTO); ReturnOffer ReturnOffer2 = Mapper.Map<ReturnOffer>(returnOfferDTO); _eCtxt.ReturnOffer.Add(newReturnOffer); foreach (var ReturnItem in newReturnOffer.ReturnOfferItems) { _eCtxt.Entry(ReturnItem).State = EntityState.Added; } _eCtxt.SaveChanges(); ReturnOfferDTO sendback = Mapper.Map<ReturnOfferDTO>(newReturnOffer); return sendback; }
public ReturnOfferDTO CreateNewReturnOffer(ReturnOfferDTO returnOffer) { var RetDTO = _exchangeRepo.SaveNewReturnOffer(returnOffer); return RetDTO; }