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(); }
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()); }