input: from typing import Callable
  
  def convert_to_csharp(function: Callable, function_name: str) -> str:
      """ Convert a given Python function to a C# function.
      >>> convert_to_csharp(lambda x, y: x * power(x, y - 1), "power")
      'public int power(int x, int y) { if (y == 0) { return 1; } else { return x * power(x, y - 1); } }'
      """
output:     source_code = inspect.getsource(function)
      source_code = textwrap.dedent(source_code)
      tree = ast.parse(source_code)
      
      class CSharpConverter(ast.NodeVisitor):
          def visit_FunctionDef(self, node):
              return_type = "int"  # Assume int for simplicity
              parameters = ", ".join([f"int {arg.arg}" for arg in node.args.args])
              body = "\n".join([self.visit(stmt) for stmt in node.body])
              return f"public {return_type} {function_name}({parameters}) {{\n{body}\n}}"
          
          def visit_Assign(self, node):
              target = node.targets[0].id
              value = self.visit(node.value)
              return f"int {target} = {value};"
          
          def visit_Return(self, node):
              value = self.visit(node.value)
              return f"return {value};"
          
          def visit_BinOp(self, node):
              left = self.visit(node.left)
              right = self.visit(node.right)
              op = type(node.op).__name__
              if op == "Add":
                  return f"{left} + {right}"
              elif op == "Sub":
                  return f"{left} - {right}"
              elif op == "Mult":
                  return f"{left} * {right}"
              elif op == "Div":
                  return f"{left} / {right}"
              elif op == "Pow":
                  return f"Math.Pow({left}, {right})"
          
          def visit_Compare(self, node):
              left = self.visit(node.left)
              right = self.visit(node.comparators[0])
              op = type(node.ops[0]).__name__
              if op == "Eq":
                  return f"{left} == {right}"
              elif op == "NotEq":
                  return f"{left} != {right}"
              elif op == "Lt":
                  return f"{left} < {right}"
              elif op == "LtE":
                  return f"{left} <= {right}"
              elif op == "Gt":
                  return f"{left} > {right}"
              elif op == "GtE":
                  return f"{left} >= {right}"
          
          def visit_If(self, node):
              test = self.visit(node.test)
              body = "\n".join([self.visit(stmt) for stmt in node.body])
              orelse = "\n".join([self.visit(stmt) for stmt in node.orelse])
              return f"if ({test}) {{\n{body}\n}}" + (f" else {{\n{orelse}\n}}" if orelse else "")
          
          def visit_Call(self, node):
              func = self.visit(node.func)
              args = ", ".join([self.visit(arg) for arg in node.args])
              return f"{func}({args})"
          
          def visit_Name(self, node):
              return node.id
          
          def visit_Constant(self, node):
              return str(node.value)
      
      converter = CSharpConverter()
      csharp_code = converter.visit(tree.body[0])
      return csharp_code