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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Model validation class should be allowed to have a constructor with parameters - now the validation ends with the
InvalidOperationException
.(There is a related pull request for
record
type #23976).Motivation and goals
The constructor would allow us to use non-nullable properties as
Required
without the worry about theExamples
The usage would be simple:
Without the need to disable warning CS8618 or write something like
public string MyPath { get; set; } = null!;
Usage in the controller would still be the same.
Beta Was this translation helpful? Give feedback.
All reactions