public ActionResult SearchBook(BookSearchModel model)
{
using(var db = new BooksEntities())
{
var bookName = db.bookTables.Where(m => m.bookName == model.bookName).ToList();
if(bookName.Count >= 1)
{
foreach (var book in bookName)
{
model.bookName = book.bookName;
}
}
else
{
model.bookName = "Cannot Find Book";
}
}
return Json(model.bookName);
}
I have this code here which retrieves an item from the database which matches a certain criteria. What i want to add to this is to retrieve the progress of how far, percentage wise, it is through completing the database search. My overall aim is to create a progress bar which realistically simulates how long is left till the search is completed.
I am using MVC and entity framework.