Limit results

This commit is contained in:
2017-01-23 10:42:49 -05:00
parent 87462a674f
commit 295b40bed8
4 changed files with 11 additions and 12 deletions
+1 -1
View File
@@ -1 +1 @@
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.kctsiwr3.dll
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.rzzuwtuu.dll
+1 -8
View File
@@ -24,14 +24,7 @@ namespace LeafWeb.WebCms.App_Start
"Results/Download", // URL with parameters
new { controller = "Results", action = "Download" } // Parameter defaults
);
// route for downloading results
RouteTable.Routes.MapRoute(
"NotifyComplete", // Route name
"LeafInput/NotifyComplete", // URL with parameters
new { controller = "LeafInput", action = "NotifyComplete" } // Parameter defaults
);
base.ApplicationStarted(umbracoApplication, applicationContext);
}
}
+8 -3
View File
@@ -1,3 +1,4 @@
using System;
using System.Linq;
using System.Web.Mvc;
using LeafWeb.Core.Entities;
@@ -10,10 +11,14 @@ namespace LeafWeb.WebCms.Controllers
{
public ActionResult Index()
{
var dateThreshold = DateTime.Today.Subtract(TimeSpan.FromDays(90));
var viewModel =
DataService.GetLeafInputs()
.OrderByDescending(f => f.Id)
.ToList()
(
from li in DataService.GetLeafInputs()
where li.Added >= dateThreshold
orderby li.Id descending
select li
).ToList()
.Select(leafInput => new ResultItemViewModel(leafInput));
return View(viewModel);
}
+1
View File
@@ -13,6 +13,7 @@
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.WebPages" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="Umbraco.Web" />