✅ addpizza line 41 help!
on line 41 in the addpizza tab ive written
_Toppings topping = selectToppingMenu.Topping();
but the .Topping() isnt working, why? help please!
8 Replies
BlazeBin - udnlcbzmleug
A tool for sharing your source code with the world!
it should be getting the .topping() from the editpizza tab but it isnt ;-;
its saying non invocable member EditPizzaToppings.Topping cannot be used like a method
Because the Property
Topping
is null
what can i do to save it?
You're creating a new instance, the overloaded constructor sets the
recipe
parameter to null
.
Your Select
method tries to get something, which probably result in null
as well or default
, I think it's an enum
?
Because _recipe
is null
from the beginning.hmm ok ill give it a look thanks
It's honestly a bit confusing for me; while
_Toppings
is an unflaggable enum
, how do you wanna have more than one of it in the property Toppings
?
Either make it a flaggable enum
or a List property.
Also why does the Recipe
include both, burger and pizza properties?
I would suggest beginning with an abstract class of Food
and having models for each type of food with their respective properties, like ingredients.ill try my best ;-;