title: The best extension method overload requires a receiver of type List
body: <p>the best extension method overload requires a receiver of type List
  i am facing this problem:</p>
  
  <blockquote>
    <p>list jvdem does not contain the defination for ToModelListJVDET and the best extension overload method modelhelper.ToModelListJVDET(List) requires a receiver of type list</p>
  </blockquote>
  
  <p>so please check my code and guide me how can i solve this problem   </p>
  
  <p>This is my code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>// Controller
  
  public IActionResult Index() {
      List&lt;JVDM&gt; jVDMs = new LocationHandler().GetjVDM().ToModelListJVDET();
  
      return View(jVDMs);
  }
  
  // ModelHelper class
  
  public static List&lt;JVDetModel&gt; ToModelListJVDET(this List&lt;JVDetModel&gt; entityJVDetModels) {
      List&lt;JVDetModel&gt; jVDetModel = new List&lt;JVDetModel&gt;();
  
      foreach (var i in entityJVDetModels) {
          jVDetModel.Add(i);
      }
  
      jVDetModel.TrimExcess();
      return jVDetModel;
  }
  
  
  // Location Handler
  
  public List&lt;JVDM&gt; GetjVDM() {
      using (myDBContext context = new myDBContext()) {
          return (from c in context.JVDetTable select c).ToList();
      }
  }
  </code></pre>