input: Write a function to convert a given Python program to a C# program. The function should take the Python function code as input and return the equivalent C# function code. If the input Python function is empty, 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("def greet(name):\n    return f'Hello, {name}'")=="public string Greet(string name)\n{\n    return $'Hello, {name}';\n}"
  assert convert_to_csharp("")==""
  assert convert_to_csharp("def add(a, b):\n    return a + b")=="public int Add(int a, int b)\n{\n    return a + b;\n}"
output: def convert_to_csharp(python_code):
      if not python_code:
          return ""
      
      lines = python_code.strip().split('\n')
      function_name = lines[0].split('(')[0].split(' ')[1]
      params = lines[0].split('(')[1].split(')')[0].split(', ')
      param_types = ['int' if 'int' in param else 'string' for param in params]
      param_names = [param.split(' ')[-1] for param in params]
      return_type = 'int' if 'return 1' in python_code else 'string'
      
      csharp_code = f"public {return_type} {function_name.capitalize()}({', '.join([f'{param_types[i]} {param_names[i]}' for i in range(len(params))])})\n{{\n"
      
      for line in lines[1:]:
          if line.strip().startswith('return'):
              return_value = line.strip().split('return ')[1]
              if return_type == 'string':
                  return_value = return_value.replace("'", '"')
              csharp_code += f"    return {return_value};\n"
          elif line.strip().startswith('if'):
              condition = line.strip().split('if ')[1].split(':')[0]
              csharp_code += f"    if ({condition})\n    {{\n"
          elif line.strip().startswith('else:'):
              csharp_code += "    }\n    else\n    {\n"
          elif line.strip().startswith('return'):
              return_value = line.strip().split('return ')[1]
              if return_type == 'string':
                  return_value = return_value.replace("'", '"')
              csharp_code += f"    return {return_value};\n"
      
      csharp_code += "}"
      return csharp_code