public void AddToCurrentOrder(MenuItem addingMenuItem) { var typeOfAddingOrder = FindThisTypeOfOrder(addingMenuItem); if (typeOfAddingOrder == null) { MenuItems.Add(new MenuItemQuantity {MenuItem = addingMenuItem, Quantity = 1}); } else { typeOfAddingOrder.Quantity++; } }
public void AddToCurrentOrder(MenuItem addingMenuItem) { var typeOfAddingOrder = FindThisTypeOfOrder(addingMenuItem); if (typeOfAddingOrder == null) { MenuItems.Add(new MenuItemQuantity { MenuItem = addingMenuItem, Quantity = 1 }); } else { typeOfAddingOrder.Quantity++; } }
private MenuItemQuantity FindThisTypeOfOrder(MenuItem addingMenuItem) { var thisTypeOfOrder = MenuItems.FirstOrDefault(a => a.MenuItem.Name == addingMenuItem.Name); return(thisTypeOfOrder); }
private MenuItemQuantity FindThisTypeOfOrder(MenuItem addingMenuItem) { var thisTypeOfOrder = MenuItems.FirstOrDefault(a => a.MenuItem.Name == addingMenuItem.Name); return thisTypeOfOrder; }