April 2018
Intermediate to advanced
300 pages
7h 41m
English
The var pattern checks if the var is equal to some type. The following example shows how the var pattern can be used to check for the type and print the Type name:
if (person is var Person) Console.WriteLine($"It is a person object and type is {person.GetType()}");
Read now
Unlock full access