no

Entity Framework, ToList method missing on Entity Class

If you want to use the ToList() method of an entity you need to import the namespace: using System.Linq;, else the method will not appear. ...

If you want to use the ToList() method of an entity you need to import the namespace:
using System.Linq;, else the method will not appear.

Example
using System.Linq;

public class NorthWindDemo {
  private NorthwindEntities _entities = new NorthwindEntities();
  public ActionResult Index()
  {
    return View(_entities.ProductSet.ToList());
  }
}

Related

.net 3626923490075135516

Post a Comment

1 comment

Anonymous said...

Perfect!

item