public void PlaceOrder(Library.Interfaces.IServiceRepository repo)
        {
            if (currentOrder != null)
            {
                currentOrder.PlaceOrder();
                currentOrder.Recipient.PastOrders.Add(currentOrder);
                pastOrders.Insert(0, currentOrder);
                repo.AddOrder(currentOrder);
                repo.UpdateLocation(this);
                repo.Save();

                currentOrder = null;
            }
            else
            {
                throw new MissingMemberException("An order cannot be placed if it doesn't exist!");
            }
        }
Beispiel #2
0
 public LocationController(Library.Interfaces.IServiceRepository _repo)
 {
     repo = _repo ?? throw new ArgumentNullException(nameof(_repo));
 }