input: from typing import List
  
  def convert_to_csharp(python_code: str) -> str:
      """ Convert a given Python function to a C# method.
      >>> 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}
      """
output:     lines = python_code.split('\n')
      csharp_code = []
      indent_level = 0
      for line in lines:
          if line.strip().startswith('def '):
              func_name = line.split('(')[0].split()[-1]
              args = line.split('(')[1].split(')')[0].split(',')
              csharp_args = ', '.join([arg.split(':')[0].strip() + ' ' + arg.split(':')[1].strip() for arg in args])
              csharp_code.append(f"public int {func_name.capitalize()}({csharp_args})")
              csharp_code.append("{")
              indent_level += 1
          elif line.strip().startswith('if '):
              csharp_code.append('    ' * indent_level + line.replace('if ', 'if (').replace(':', ')'))
              csharp_code.append('    ' * indent_level + "{")
              indent_level += 1
          elif line.strip().startswith('else:'):
              indent_level -= 1
              csharp_code.append('    ' * indent_level + "}")
              csharp_code.append('    ' * indent_level + line.replace('else:', 'else'))
              csharp_code.append('    ' * indent_level + "{")
              indent_level += 1
          elif line.strip().startswith('return '):
              csharp_code.append('    ' * indent_level + line.replace('return ', 'return ') + ';')
          elif line.strip() == '':
              continue
          else:
              csharp_code.append('    ' * indent_level + line)
      csharp_code.append('    ' * (indent_level - 1) + "}")
      return '\n'.join(csharp_code)