Beispiel #1
0
        public string GetShipmentFullName(CurrencyExchangeRepository currencyRepo, int shipmentId)
        {
            var shipment =
                (from s in db.Shipments
                 where s.Id == shipmentId
                 select s).First();

            var shipmentName = shipment.Name + " " + currencyRepo.Exchange(shipment.Price);

            return(shipmentName);
        }
Beispiel #2
0
        public List <ShipmentsWithFullNames> GetList(CurrencyExchangeRepository currencyRepo, string currencyCode)
        {
            var shipments =
                (from s in db.Shipments select s).ToList();

            var shipmentsWithFullNames = new List <ShipmentsWithFullNames>();

            foreach (var s in shipments)
            {
                shipmentsWithFullNames.Add(new ShipmentsWithFullNames()
                {
                    Id = s.Id, Name = s.Name + " " + currencyRepo.Exchange(s.Price, currencyCode)
                });
            }

            return(shipmentsWithFullNames);
        }