title: pass class type as parameter c# and used with dictionary
body: <p>I am create a function to return a dictionary and I want to pass class name through as a parameter. But its gives an error. Code i have written is given below </p>
  
  <pre><code>public Dictionary&lt;object, object&gt; GetDetails(Type Classname)
  {
      MvcDemoDBEntities db = new MvcDemoDBEntities();
      Dictionary&lt;Classname, object&gt; dict = new Dictionary&lt;Classname, object&gt;();
  
      var data = (from h in db.People
                  select h).ToList();
  
      foreach (var item in data)
      {
          dict.Add(data, true);
      }
      return dict;
  }
  </code></pre>
  
  <p>what am i doing wrong 
   and i would like to call this function with a class name dynamically, like this :</p>
  
  <pre><code>List&lt;people&gt; list = GetDetails(people).Keys.ToList();
  </code></pre>
  
  <p>people its my class name.</p>