I need convert to this code from php to c#. Help me, Thanks!

function api($path, $post_data = array()) {
$class = "AC_" . $class;
// IE: new Contact();

$class = new $class($this->url, $this->api_key);
// IE: $contact->view();


$response = $class->$method($params, $post_data);
return $response;
}