input: Write a function to convert a given Python program to a C# program. The function should accept a string representation of the Python code and return a string representation of the equivalent C# code. If the input Python code is invalid or cannot be converted, return an empty string.
  assert convert_python_to_csharp("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_python_to_csharp("def add(a, b):\n    return a + b")=="public int Add(int a, int b)\n{\n    return a + b;\n}"
  assert convert_python_to_csharp("invalid python code")==""
  assert convert_python_to_csharp("")==""
output: def convert_python_to_csharp(python_code):
      if not python_code or "def " not in python_code:
          return ""
      
      lines = python_code.strip().split("\n")
      if not lines or not lines[0].startswith("def "):
          return ""
      
      function_line = lines[0]
      function_name = function_line.split("(")[0][4:].strip()
      params = function_line[function_line.index("(")+1:function_line.index(")")].split(",")
      param_list = ", ".join([p.strip() + " int" for p in params])
      
      csharp_code = f"public int {function_name.capitalize()}({param_list})\n{{\n"
      
      for line in lines[1:]:
          if line.strip().startswith("return "):
              csharp_code += "    " + line.replace("return ", "return ") + ";\n"
          elif line.strip().startswith("if "):
              csharp_code += "    " + line.replace(":", "").replace("if ", "if (") + ")\n    {\n"
          elif line.strip().startswith("else:"):
              csharp_code += "    }\n    else\n    {\n"
          elif line.strip() == "":
              continue
          else:
              csharp_code += "    " + line.strip() + "\n"
      
      csharp_code += "}"
      
      return csharp_code