title: C# Converting a string variable to an object type reference
body: <p>My MVC5 custom Html helper class has following method:</p>
  
  <pre><code>public static bool CheckAccessRight(this HtmlHelper htmlHelper, string Action, string Controller)
  {
      string displayName = GetPropertyDisplayName&lt;Controller&gt;(i =&gt; i.Action);
      // according to logic return a bool
  }
  </code></pre>
  
  <p>GetPropertyDisplayName method:</p>
  
  <pre><code>public static string GetPropertyDisplayName&lt;T&gt;(Expression&lt;Func&lt;T, object&gt;&gt; propertyExpression)
  {
  // some code
  }
  </code></pre>
  
  <p>As you can see GetPropertyDisplayName method is expecting a class(a type) and class member as it's parameters.</p>
  
  <p>But in my CheckAccessRight method I'm just receiving class name (<code>string Controller</code>) and member (<code>string Action</code>) as strings.</p>
  
  <p>So obviously I'm getting an error at this segment: <code>&lt;Controller&gt;(i =&gt; i.Action);</code></p>
  
  <p>My question is how to convert these string representations into real classes or another workaround.</p>
  
  <p>Thanks!</p>