I have a C# 8 class (in .NET Core 3 preview 7):
#nullable enable
class TypeWithNullableRefs
{
public string NonNullableString { get; } = "";
public string? NullableString { get; }
}
#nullable restore
I'm trying to detect the nullability via the NullableAttribute
attribute that is added via the new feature of nullable reference types.
When I debug the PropertyInfo
of the first NonNullableString
field I get no attributes:
Why isn't there any NullableAttribute
?
A reproducible project can be found by following these steps.
Aucun commentaire:
Enregistrer un commentaire