When was the binding property pattern { } introduced? #9772
Answered
by
jnm2
The-Futurist
asked this question in
Q&A
-
|
As in: if (await datasetsRepository.GetUserData(userId) is { } userFromDatabase)
{
retrievedUsers.TryAdd(userId, userFromDatabase);
return true;
} |
Beta Was this translation helpful? Give feedback.
Answered by
jnm2
Oct 20, 2025
Replies: 3 comments
-
|
It's the empty property pattern. There's no real reason to add a specific error for using it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
C# version 8.0. This feature was called recursive patterns but as more recursive patterns were added later, is now called the property pattern. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
The-Futurist
-
|
Fascinating I never noticed it before even though I scoured the docs back then. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C# version 8.0. This feature was called recursive patterns but as more recursive patterns were added later, is now called the property pattern.