❔ Continue a switch statement
The switch statement is very convenient for managing my types.
I would like to instead of just having one of these hit, for it to hit any that meet criteria.
8 Replies
You can let a case fall through to the next case, but I don't think that's what you want. I think a simple series of If-statements would be the simplest here.
How can I easily determine the type in an if statement?
You can use when with case
the
is
operatorThe
is
operator - Match an expression against a type or constant ...Learn about the C#
is
operator that matches an expression against a pattern. The is
operator returns true when the expression matches the pattern.:S
etc
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.