Exemplo n.º 1
0
 /* This function was written by Lennart de Waart (563079) */
 /// <summary>
 /// Asynchronous method that retrieves a list of deliverers who are available, do not have a current delivery and are in range of the customer.
 /// </summary>
 /// <param name="v">Best suited vehicle for delivery</param>
 /// <param name="dueDate"></param>
 /// <param name="config">Configuration of variables</param>
 /// <returns>List of Deliverer classes</returns>
 public List <Deliverer> GetDeliverersPool(Vehicles v, DateTime dueDate, dynamic config)
 {
     try
     {
         _logger.Information($"A request has been made to create a Deliverers pool from the available deliverers for a delivery from the context.");
         List <Deliverer> d = _deliverersRepo.GetDeliverersPool(v, dueDate, config);
         return(d ?? throw new ArgumentNullException($"Dependency failure: The repository result returned null."));
     }
     catch (Exception e) // Error handling
     {
         _logger.Error($"IDeliverersService says: {e.Message} Exception occured on line {new StackTrace(e, true).GetFrame(0).GetFileLineNumber()}.");
         return(null);
     }
 }