One of the best features of C# is the ?? "null coalescing" operator. This provides a nice way to check whether a value is null, and if so return an alternate value.

The ?? operator defines the default value to be returned when a nullable type is assigned to a non-nullable type. If you try to assign a nullable type to a non-nullable type without using the ?? operator, you will generate a compile-time error.

The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand.