Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   WebDoAnTotNghiep.Controllers.<>c__DisplayClass1d.<d>b__1a(Subject c) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Controllers\doanController.cs:90
   System.Linq.WhereListIterator`1.MoveNext() +77
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +123
   System.Linq.<GetEnumerator>d__1.MoveNext() +184
   System.Linq.Enumerable.Count(IEnumerable`1 source) +185
   lambda_method(Closure ) +49
   System.Linq.EnumerableExecutor`1.Execute() +94
   System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +73
   System.Linq.Queryable.Count(IQueryable`1 source) +204
   MvcPaging.PagedList`1.Initialize(IQueryable`1 source, Int32 index, Int32 pageSize, Nullable`1 totalCount) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Helpers\MvcPaging\PagedList.cs:63
   MvcPaging.PagedList`1..ctor(IEnumerable`1 source, Int32 index, Int32 pageSize, Nullable`1 totalCount) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Helpers\MvcPaging\PagedList.cs:16
   MvcPaging.PagedList`1..ctor(IEnumerable`1 source, Int32 index, Int32 pageSize) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Helpers\MvcPaging\PagedList.cs:10
   MvcPaging.PagingExtensions.ToPagedList(IEnumerable`1 source, Int32 pageIndex, Int32 pageSize) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Helpers\MvcPaging\PagingExtensions.cs:77
   WebDoAnTotNghiep.Controllers.doanController.d(String id, Nullable`1 page) in E:\Website Moi\WebDoAnTotNghiep\WebDoAnTotNghiep\Controllers\doanController.cs:91
   lambda_method(Closure , ControllerBase , Object[] ) +124
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +205
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +56
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +256
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +22
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +363
   System.Web.Mvc.Controller.ExecuteCore() +193
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +28
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +142
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +42
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +10
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0