input: Write a function to convert a given Python program to a C# program. If the Python program is a function that calculates the power of a number, convert it to a C# function with the same functionality. If the input Python program is not a function, return an empty string.
  
  string convert_to_csharp(string python_code)
  
  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("not a function") == ""
  assert convert_to_csharp("") == ""
output: import re
  
  def convert_to_csharp(python_code):
      if not re.match(r'^def\s+\w+\s*\(', python_code):
          return ""
      
      function_name = re.search(r'^def\s+(\w+)\s*\(', python_code).group(1)
      parameters = re.search(r'\((.*?)\)', python_code).group(1)
      param_list = [param.strip() for param in parameters.split(',')]
      
      csharp_params = ', '.join([f'int {param}' for param in param_list])
      csharp_code = f"public int {function_name.capitalize()}({csharp_params})\n{{\n"
      
      python_code = python_code.replace('def', '').strip()
      python_code = python_code.replace('return', 'return ')
      python_code = python_code.replace('if', 'if (')
      python_code = python_code.replace(':', ')')
      python_code = python_code.replace('else:', 'else')
      python_code = python_code.replace('power', function_name.capitalize())
      python_code = python_code.replace('\n    ', '\n    ')
      
      csharp_code += python_code.replace('\n', '\n    ')
      csharp_code += "\n}"
      
      return csharp_code