dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

Add information on Reference Type Nullability during runtime

Open hexxone opened this issue 4 months ago • 2 comments

In reference to https://github.com/dotnet/runtime/issues/101438

I have been looking for a way to determine the Nullability of "string?" Properties on DTOs during runtime.

But this happens mostly during compile-time and gets converted to "string" with a special compiler "NullableAttribute" instead.

Finding the proper solution was hard, because the Nullable Reference Type docs have no hint or link to the NullabilityInfoContext which can be used for exactly this purpose.

It would be great to add a note of some kind to either the Nullable Reference Type docs above and/or the Nullable Analysis docs.

Because the Nullable Value Type docs also contain a reference to the related Nullable.GetUnderlyingType() docs.

hexxone avatar Apr 24 '24 17:04 hexxone

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet/area-system-reflection

ManickaP avatar Apr 29 '24 07:04 ManickaP