C
C#11mo ago
Lyno

System.IO.Pipelines.ReadResult

why does the ReadResult struct have different properties exposed when i make it nullable?
No description
No description
5 Replies
Jimmacle
Jimmacle11mo ago
is it a struct?
Lyno
LynoOP11mo ago
yes
Jimmacle
Jimmacle11mo ago
then it's because ReadResult? is actually Nullable<ReadResult> and you have to access the Value property to get the actual ReadResult or use a conditional access operator etc to strip off the nullability
Lyno
LynoOP11mo ago
aah i see, thats odd ive never seen this before and my IDE isnt telling me about it but thank you appreciate the help
Jimmacle
Jimmacle11mo ago
it's the only way structs can be nullable, since a struct itself can never be null
Want results from more Discord servers?
Add your server