in Older/ReSharper20172CSharp/PatternMatching.cs [36:51]
public void ConvertToSwitch(IShape shape)
{
// Alt+Enter on if, convert to switch statement
if (shape == null) return;
if (shape is Circle circle)
{
// do circular stuff
Console.WriteLine(circle.Radius);
}
else if (shape is Rectangle rectangle)
{
// do rectangular stuff
Console.WriteLine(rectangle.Length);
}
}