コード例 #1
0
        /// <summary>
        /// Returns the shipment by Id
        /// </summary>
        /// <param name="invoiceId">Shipment Id</param>
        /// <returns>Shipment Dto model</returns>
        public InvoiceDto GetById(int invoiceId)
        {
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap <Invoice, InvoiceDto>()).CreateMapper();

            Invoice    invoice    = (Invoice)invoicesRepository.GetById(invoiceId);
            InvoiceDto invoiceDto = mapper.Map <InvoiceDto>(invoice);

            invoiceDto.PostOperatorName = invoicesRepository.GetPostOperatorsIdNames()[invoice.PostOperatorId];

            return(invoiceDto);
        }