Код: Выделить всё
private SomeFormModel _someModel;
[MemberNotNull(nameof(_someModel))]
public SomeFormModel SomeModel
{
get => _someModel;
set
{
_someModel = value;
_someModel.Subview = true;
}
}
public CurrentFormModel()
{
SomeModel = new();
}
Код: Выделить всё
CS8774 Member '_someModel' must have a non-null value when exiting.
CS8603 Possible null reference return.
Код: Выделить всё
CS8618 Non-nullable field '_someModel' must contain a non-null value when exiting constructor...
Подробнее здесь: https://stackoverflow.com/questions/792 ... and-member
Мобильная версия