public ViewResult Index(QueryBag queryBag ,string returnUrl)
 {
     return View(new QueryBagIndexViewModel
     {
         QueryBag = queryBag,
         ReturnUrl = returnUrl
     });
 }
 public RedirectToRouteResult AddToQueryBag(QueryBag queryBag ,int queryId, string returnUrl)
 {
     //place GW2 Api query code here
     //Placeholder variable
     QueryResult resultToAdd = new QueryResult() {QueryId = queryId };
     queryBag.AddQueryResult(resultToAdd);
     return RedirectToAction("Index", new {returnUrl});
 }
 public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
 {
     //Get the Query Bag from the Session
     QueryBag queryBag = null;
     if (controllerContext.HttpContext.Session != null)
     {
         queryBag = (QueryBag) controllerContext.HttpContext.Session[sessionKey];
     }
     //Create the Query Bag if there wasn't one in the session data
     if (queryBag == null)
     {
         queryBag = new QueryBag();
         if (controllerContext.HttpContext.Session != null)
         {
             controllerContext.HttpContext.Session[sessionKey] = queryBag;
         }
     }
     //return the Query Bag
     return queryBag;
 }
 public PartialViewResult Summary(QueryBag queryBag)
 {
     return PartialView(queryBag);
 }
 public RedirectToRouteResult RemoveFromQueryBag(QueryBag queryBag ,int queryId, string returnUrl)
 {
     queryBag.RemoveQueryResult(queryId);
     return RedirectToAction("Index", new {returnUrl});
 }