Property Pattern: A property pattern checks that the input value is not null and recursively matches values extracted by the use of accessible properties or fields.
string s =null;
if (s is not { } documentId)
{
}
else
{
string mj = documentId;
}
Declaration Pattern: The declaration_pattern both tests that an expression is of a given type and casts it to that type if the test succeeds. This may introduce a local variable of the given type named by the given identifier, if the designation is a single_variable_designation.
Here first check profileDocument.documentId is null or not. after that if not null then value asign to new a variable documentId
.
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/patterns#property-pattern