Home > Net >  Where the.net MVC5 database query results can be called again
Where the.net MVC5 database query results can be called again

Time:10-08


Where.net MVC5 database query results can be filtered called again, sort?
ViewBag, codebehind (categories.aspx.cs) save again get to null,
The Session save, again is not null, but prompt DbContext is released,

The query, save:
IQueryable Query=db. Books;
Query=query. The where (... );
The Session (" query ")=query;

Through Ajax calls in another way:
IQueryable Query=(IQueryable) The Session (" query ");
Query=query. The where (... & & . );

JsonSerializerSettings Settings=new JsonSerializerSettings
{
ReferenceLoopHandling=ReferenceLoopHandling. Ignore
};
Return the Content (JsonConvert SerializeObject (query. ToList (), Settings));

Error:
System. InvalidOperationException: "The operation always be completed because The DbContext has had been disposed."
Excuse me, how to solve the

CodePudding user response:

But prompt DbContext has released
You use the using?
To try new

CodePudding user response:

Hello! Excuse me where changes? Link is a Java, look not to understand, please give directions,
  • Related