rename query to model in actions, fixing problems with binding

This commit is contained in:
2020-08-01 21:14:40 -04:00
parent 9986ce5ee6
commit 77624d4571
2 changed files with 12 additions and 13 deletions
+5 -6
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Caching;
@@ -20,13 +19,13 @@ namespace LeafWeb.WebCms.Controllers
{
private const int TimeSamples = 40;
public ActionResult Index(LeafDataQuery query)
public ActionResult Index(LeafDataQuery model)
{
var resultItems =
DataService.GetLeafInputsOrdered();
resultItems
= QueryFilter.Search(resultItems, query, Members.GetCurrentLoginStatus()?.Email);
= QueryFilter.Search(resultItems, model, Members.GetCurrentLoginStatus()?.Email);
var timeInProgressEstimater = TimeInProgressEstimater();
@@ -36,7 +35,7 @@ namespace LeafWeb.WebCms.Controllers
{
Items = resultItems,
ServerDescription = serviceDescription,
Q = query,
Q = model,
TimeInProgressEstimater = timeInProgressEstimater
};
@@ -45,14 +44,14 @@ namespace LeafWeb.WebCms.Controllers
[HttpPost]
public ActionResult Search(LeafDataQuery query)
public ActionResult Search(LeafDataQuery model)
{
if (!ModelState.IsValid)
{
return CurrentUmbracoPage();
}
return RedirectToCurrentUmbracoPage(query.GetNameValueCollection());
return RedirectToCurrentUmbracoPage(model.GetNameValueCollection());
}
private TimeInProgressEstimater TimeInProgressEstimater()