mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-02-02 13:07:34 +00:00
Don't dispose the db context.
This commit is contained in:
parent
97e67c021d
commit
908b50cb47
1 changed files with 11 additions and 10 deletions
|
@ -40,8 +40,9 @@ namespace Project_Unite.Controllers
|
|||
{
|
||||
var result = new SearchResult();
|
||||
query = query.ToLower();
|
||||
using(var db = new ApplicationDbContext())
|
||||
{
|
||||
var db = new ApplicationDbContext();
|
||||
|
||||
|
||||
result.Downloads = db.Downloads.Where(x => x.Name.ToLower().Contains(query) || x.Changelog.ToLower().Contains(query));
|
||||
result.ForumTopics = db.ForumTopics.Where(x => x.Subject.ToLower().Contains(query));
|
||||
result.Skins = db.Skins.Where(x => x.Name.ToLower().Contains(query) || x.ShortDescription.ToLower().Contains(query) || x.FullDescription.ToLower().Contains(query));
|
||||
|
@ -49,7 +50,7 @@ namespace Project_Unite.Controllers
|
|||
result.WikiPages = db.WikiPages.Where(x => x.Name.ToLower().Contains(query) || x.Contents.ToLower().Contains(query));
|
||||
//Holy crap that search was... long.
|
||||
return View(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue