as vs cast c# performance code example Example: c# quick "is" "as" if (randomObject is TargetType tt) { // Use tt here }