! 0Falco
Explore posts from serversHow to get rid of nullable warning?
So I have this code where I get data from an api which is nested
in some objects I can retrieve it using:
weatherData.Hourly.Time
So this is a nested object but if I want the time value, I cannot just check if weatherData is null
. I also have to check if weatherData.Hourly is null
.
But then my code ends up like this
15 replies
Practicing OOP in c#, is this logical implementation of an Interface?
So I could also do this
Instead of using
IOutputHandler
as a interface, I can just call each handler from Main()
like this.
But an interface would be more practical because of abstraction, I dont have to create a tightly coupled instance with each specific handler classes to access it. So it's better to just call the interface instead, like this:
65 replies