/// <summary> /// Returns all user-generated shipments in the Delivery service /// </summary> /// <returns>List of shipments</returns> public IEnumerable <InvoiceDto> GetAll() { var mapper = new MapperConfiguration(cfg => cfg.CreateMap <Invoice, InvoiceDto>()).CreateMapper(); List <InvoiceDto> invoiceDtos = new List <InvoiceDto>(); foreach (var invoice in invoicesRepository.GetAll()) { InvoiceDto invoiceDto = mapper.Map <InvoiceDto>(invoice); invoiceDto.PostOperatorName = invoicesRepository.GetPostOperatorsIdNames()[invoice.PostOperatorId]; invoiceDtos.Add(invoiceDto); } return(invoiceDtos); }