We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b2c951 commit 89bc37dCopy full SHA for 89bc37d
docs/csharp/language-reference/keywords/snippets/InitExample5.cs
@@ -5,7 +5,7 @@ public int YearOfBirth
5
get;
6
init
7
{
8
- field = (YearOfBirth <= DateTime.Now.Year)
+ field = (value <= DateTime.Now.Year)
9
? value
10
: throw new ArgumentOutOfRangeException(nameof(value), "Year of birth can't be in the future");
11
}
0 commit comments