I am trying to solve this problem and did read content regarding this error but was unable to figure out a solution.
I am building a winforms application using Entity framework for a simple Products Categories scenario.
Here is a snapshot of my model.

The code in ProductService class that retrieves all the products is
public static List<Product> GetAllProducts()
{
List<Product> products = new List<Product>();
using (var entity = new SUIMSEntities1())
{
products = (from p in entity.Products
select p).ToList();
return products;
}
}
Code in the Products code behind is
List<Product> prods=ProductServices.GetAllProducts();
dgvProducts.DataSource = prods;
When I try to load the Products in datagridview, the following error is shown:

Could you please tell me what is causing the problem?
Edit:
The Include did the trick and in this specific scenario I changed the GetAllProducts() as below
public static List<Product> GetAllProducts()
{
using (var entity = new SUIMSEntities1())
{
List<Product> products = entity.Products.Include("Category").ToList();
return products;
}
}
By default, entity framework (EF) will lazy load your Category object set. Because your Category object set is lazy loaded, when some other code later on references a Category, EF will try to load the set. However, at this point, your context has been disposed, resulting in the error you are seeing.
What you need to do is force the context to eagerly load your Category entity set like so: