input: Write a function to convert a given Python program to a C# program. The function should take a Python function definition as input and return the corresponding C# function definition. If the input is empty or invalid, return an empty string.
  assert convert_py_to_cs("def power(x, y):\\n    if y == 0:\\n        return 1\\n    else:\\n        return x * power(x, y - 1)") == "public int Power(int x, int y)\\n{\\n    if (y == 0)\\n    {\\n        return 1;\\n    }\\n    else\\n    {\\n        return x * Power(x, y - 1);\\n    }\\n}"
  assert convert_py_to_cs("") == ""
  assert convert_py_to_cs("invalid input") == ""
output: def convert_py_to_cs(py_func):
      if not py_func or not py_func.startswith("def "):
          return ""
      
      lines = py_func.splitlines()
      if not lines:
          return ""
      
      func_def = lines[0]
      func_name = func_def.split("(")[0].split(" ")[1]
      params = func_def.split("(")[1].split(")")[0].split(", ")
      param_types = ["int " + p for p in params]
      csharp_params = ", ".join(param_types)
      
      csharp_func = f"public int {func_name}({csharp_params})\n{{\n"
      
      for line in lines[1:]:
          if line.strip().startswith("return "):
              csharp_func += "    " + line.replace("return ", "return ") + ";\n"
          elif line.strip().startswith("if "):
              csharp_func += "    " + line.replace("if", "if (") + ")\n    {\n"
          elif line.strip().startswith("else:"):
              csharp_func += "    }\n    else\n    {\n"
          elif line.strip() == "":
              continue
          else:
              csharp_func += "    " + line + "\n"
      
      csharp_func += "}\n}"
      
      return csharp_func