public static IList<CarrierViewModel> CreateCarrierViewModelsForNotification(
            MeansOfTransport meansOfTransport,
            CarrierCollection carrierCollection,
            MeansOfTransportFormatter meansOfTransportFormatter)
        {
            if (meansOfTransport == null
                || carrierCollection == null
                || carrierCollection.Carriers == null
                || !carrierCollection.Carriers.Any())
            {
                return new CarrierViewModel[0];
            }

            var meansOfTransportDisplay = meansOfTransportFormatter.MeansOfTransportAsString(meansOfTransport.Route);

            return carrierCollection.Carriers.Select(c => new CarrierViewModel(c, meansOfTransportDisplay))
                .ToArray();
        }
Exemplo n.º 2
0
        public static IList <CarrierViewModel> CreateCarrierViewModelsForNotification(
            MeansOfTransport meansOfTransport,
            CarrierCollection carrierCollection,
            MeansOfTransportFormatter meansOfTransportFormatter)
        {
            if (meansOfTransport == null ||
                carrierCollection == null ||
                carrierCollection.Carriers == null ||
                !carrierCollection.Carriers.Any())
            {
                return(new CarrierViewModel[0]);
            }

            var meansOfTransportDisplay = meansOfTransportFormatter.MeansOfTransportAsString(meansOfTransport.Route);

            return(carrierCollection.Carriers.Select(c => new CarrierViewModel(c, meansOfTransportDisplay))
                   .ToArray());
        }