11.
Reutilizar consultas en el Generador de consultas
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
4 Comments
Before aksing, thank you so much for your great job.
I get this error:
if a category is empty (0 fortuneCoockie). How to check the case in CategoryFortuneStats constructor?
Thank you in advance
Claudio
Hey @Claudio-B ,
Well, you just need make sure you pass an integer to the constructor of your
CategoryFortuneStats, i.e. instead of null pass 0 for example. To avoid multiple checks in multiple places beforenew CategoryFortuneStats()you can make sure your repository method that calculates the number always returns an integer, i.e. do something like this:But if you want to do this check in the constructor of
CategoryFortuneStats- just allow passingnullfor thatfortunesPrintedargument, i.e.Something like this, I hope this helps! :)
Cheers!
Very kind of you!
Ciao!
Glad it helped! :)
Cheers!
"Houston: no signs of life"
Start the conversation!