Note that there are some explanatory texts on larger screens.

plurals
  1. POpassing an instance into a method in c#
    primarykey
    data
    text
    <p>so ive been doing this assignment all night now and I think ive gone completely wrong on one part. this is the section im stuck on:</p> <ol> <li>TableOrder class will carry two methods for adding items from the menu: AddFood(), AddDrink(). Each method will pass in a prepared instance of either the FoodItem or DrinkItem class you previously created. It is expected that the order system will maintain a separate collection of drinks from food given that we will be passing the drinks orders to bar staff and likewise food orders to the kitchen. </li> </ol> <p>I have previously created two classes to for FoodItem and DrinkItem but am struggling to grasp the concept of what the question is asking. Please help!</p> <p>hopefully somebody can explain what it is i am doin wrong. this is the code i have so far...</p> <pre><code>List&lt;DrinkItem&gt; DrinkMenu = new List&lt;DrinkItem&gt;(); public DrinkItem AddDrink(DrinkItem drinkItem) { return drinkItem; } public List&lt;DrinkItem&gt; OrderedDrink { get { return DrinkMenu; } } </code></pre> <p>the next section is as follows:</p> <ol> <li>The TableOrder class provides two separate properties given below, each of which returns a copy of the stored items. Each are expected to return an instance of the List class where T is the appropriate class. It is not expected that I can set these food and drink using these properties. a. OrderedFood b. OrderedDrink.</li> </ol> <p>i have ammended the first section and it works, but it has now given me errors on my 2nd part... any ideas as to why this might have happened?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload