public async Task <ActionResult> Filter(FilterProductsViewModel filterProductsViewModel) { var filterStr = ProductFactory.Make(filterProductsViewModel); // Save filter string in session to use when exporting excel HttpContext.Session.SetString("FilterStr", filterStr); ViewBag.filterText = !string.IsNullOrEmpty(filterStr) ? "Filtered products for " + filterStr.Replace("?", "").Replace("&", ",") : ""; return(View("Index", await _service.GetProductsByFilter(filterStr))); }