concept shape in category c#
appears as: shape, shape, shapes, shapes

This is an excerpt from Manning's book C# in Depth, Fourth Edition.
C# has been a statically typed language from the start: your code specifies the types of variables, parameters, values returned from methods, and so on. The more precisely you can specify the shape of the data your code accepts and returns, the more the compiler can help you avoid mistakes.
Listing 12.13. Using type patterns instead of as/if
static double Perimeter(Shape shape) { if (shape == null) throw new ArgumentNullException(nameof(shape)); if (shape is Rectangle rect) return 2 * (rect.Height + rect.Width); if (shape is Circle circle) return 2 * PI * circle.Radius; if (shape is Triangle triangle) return triangle.SideA + triangle.SideB + triangle.SideC; throw new ArgumentException( $"Shape type {shape.GetType()} perimeter unknown", nameof(shape)); } !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":4,\"ch\":8},{\"line\":4,\"ch\":31}],[{\"line\":6,\"ch\":8},{\"line\":6,\"ch\":30}],[{\"line\":8,\"ch\":8},{\"line\":8,\"ch\":34}]]"} !@%STYLE%@!
Listing 15.10. Using a switch expression to implement an expression-bodied method
static double Perimeter(Shape shape) => shape switch { null => throw new ArgumentNullException(nameof(shape)), Rectangle rect => 2 * (rect.Height + rect.Width), Circle circle => 2 * PI * circle.Radius, Triangle triangle => triangle.SideA + triangle.SideB + triangle.SideC, _ => throw new ArgumentException( $"Shape type {shape.GetType()} perimeter unknown", nameof(shape)) };