concept be operator in category c#

appears as: is operator, n is operator
C# in Depth, Fourth Edition

This is an excerpt from Manning's book C# in Depth, Fourth Edition.

This allows you to safely convert from an arbitrary reference to a value in a single step, although you’d normally check whether the result is null afterward. In C# 1, you’d have had to use the is operator followed by a cast, which is inelegant; it’s essentially asking the CLR to perform the same type check twice.

C# 7.0 introduces three kinds of patterns: constant patterns, type patterns, and the var pattern. I’m going to demonstrate each with the is operator, which is one of the contexts for using patterns.

12.5. Using patterns with the is operator

The is operator can be used anywhere as part of a normal expression. It’s almost always used with if statements, but it certainly doesn’t have to be. Until C# 7, the right-hand side of an is operator had to be just a type, but now it can be any pattern. Although this does allow you to use the constant or var patterns, realistically you’ll almost always use type patterns instead.