C
C#6mo 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
Jimmacle6mo ago
is it a struct?
Lyno
Lyno6mo ago
yes
Jimmacle
Jimmacle6mo 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
Lyno6mo 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
Jimmacle6mo ago
it's the only way structs can be nullable, since a struct itself can never be null