input: Write a function to convert a given Python program to a C# program. The function should accept the Python code as a string input and return the equivalent C# code as a string output. If the input Python code is not valid, the function should 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("") == ""
output: def convert_python_to_csharp(python_code):
      if not python_code:
          return ""
      try:
          tree = ast.parse(python_code)
      except SyntaxError:
          return ""
      
      if len(tree.body) != 1 or not isinstance(tree.body[0], ast.FunctionDef):
          return ""
      
      func_def = tree.body[0]
      func_name = func_def.name
      args = [arg.arg for arg in func_def.args.args]
      csharp_code = f"public int {func_name.capitalize()}({', '.join(['int ' + arg for arg in args])}" + "\n{\n"
      
      for stmt in func_def.body:
          if isinstance(stmt, ast.If):
              csharp_code += "    if (" + ast.unparse(stmt.test).replace("==", "==") + ")\n    {\n"
              csharp_code += "        " + ast.unparse(stmt.body[0]).replace("return", "return") + ";\n"
              csharp_code += "    }\n"
              if stmt.orelse:
                  csharp_code += "    else\n    {\n"
                  csharp_code += "        " + ast.unparse(stmt.orelse[0]).replace("return", "return") + ";\n"
                  csharp_code += "    }\n"
          elif isinstance(stmt, ast.Return):
              csharp_code += "    " + ast.unparse(stmt).replace("return", "return") + ";\n"
      
      csharp_code += "}"
      return csharp_code