input: Write a function to convert a given Python program to a C# program. The function should take the Python code as a string, and return the equivalent C# code as a string. The function should handle simple recursive functions correctly. If the input is empty, the function should return an empty string.
  assert convert_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_to_csharp("")==""
output: def convert_to_csharp(python_code):
      if not python_code:
          return ""
      csharp_code = ""
      lines = python_code.split("\n")
      for line in lines:
          if line.startswith("def "):
              func_name = line[4:line.index("(")]
              params = line[line.index("(")+1:line.index(")")]
              param_list = [p.split(":")[0] for p in params.split(", ")]
              csharp_code += f"public int {func_name.capitalize()}({', '.join(param_list)})\n{{\n"
          elif line.startswith("    if "):
              csharp_code += "    if (" + line[7:line.index(":")] + ")\n    {\n"
          elif line.startswith("        return "):
              csharp_code += "        return " + line[14:] + ";\n"
          elif line.startswith("    else:"):
              csharp_code += "    }\n    else\n    {\n"
          elif line.startswith("    return "):
              csharp_code += "        return " + line[10:] + ";\n"
      csharp_code += "    }\n}"
      return csharp_code