Exemplo n.º 1
0
        DeliveriesOfDay FillForDay(DateTime day, Delivery[] deliveries)
        {
            var deliveriesForDay = new DeliveriesOfDay(day);

            var deliverers = deliveries.Select(d => d.Deliverer).Distinct().ToArray();

            foreach (var deliverer in deliverers)
            {
                FillForDay(deliveriesForDay, deliverer, deliveries.Where(d => d.Deliverer.Equals(deliverer)).ToArray());
            }

            return(deliveriesForDay);
        }
Exemplo n.º 2
0
 void FillForDay(DeliveriesOfDay deliveriesForDay, string deliverer, Delivery[] deliveries)
 {
     deliveriesForDay.DeliveriesPerDeliverer.Add(deliverer, deliveries);
 }