1
Vote

DBContext has been disposed

description

Hi, I am using Grid.Mvc in my MVC project and getting error DBContext has been disposed while rendering the grid data _Grid.cshtml.

My code below
using (requiremententities context = new requiremententities())
{
  IQueryable<AuditLog> auditlog = context.AuditLogs.Orderby(x => x.Id);
  var model = new AuditlogViewModel()
  {
      Auditlogs = auditlog
  };

  return View(model);
}

my question is, does Grid.MVC disposed the context after it extract the results?

comments