Created
October 7, 2019 12:13
-
-
Save goldytech/417bf91ca68bd24f6bb345e3632e3c35 to your computer and use it in GitHub Desktop.
Property Pattern matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool IsHrManagerByPropertyPattern(object employee) | |
{ | |
return employee is Emp e && e is { IsManager: true, Department: {Name: "Human Resources" } }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment