You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Roslyn code analyzers will throw a `CS8616` if a non-nullable property will not be initialized after the constructor has executed. This is a problem for models that are expected to be initialized by e.g. data binding, mapping, or deserialization.
We used to work around this using the `[NotNull, DisallowNull]` attributes on a nullable property, which I liked as it was explicit about what it was doing. Unfortunately, as of .NET 5.0.4 (SDK 5.0.201), that now throws a `CS8616` as well. Given that, we need to instead use the less obvious null-forgiving operator instead with these cases.
Given this, I've replaced the cases where we were using `[NotNull, DisallowNull]` with `= default!;` on a non-nullable type instead.
0 commit comments