Limit results
This commit is contained in:
@@ -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
|
||||||
@@ -24,14 +24,7 @@ namespace LeafWeb.WebCms.App_Start
|
|||||||
"Results/Download", // URL with parameters
|
"Results/Download", // URL with parameters
|
||||||
new { controller = "Results", action = "Download" } // Parameter defaults
|
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);
|
base.ApplicationStarted(umbracoApplication, applicationContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using LeafWeb.Core.Entities;
|
using LeafWeb.Core.Entities;
|
||||||
@@ -10,10 +11,14 @@ namespace LeafWeb.WebCms.Controllers
|
|||||||
{
|
{
|
||||||
public ActionResult Index()
|
public ActionResult Index()
|
||||||
{
|
{
|
||||||
|
var dateThreshold = DateTime.Today.Subtract(TimeSpan.FromDays(90));
|
||||||
var viewModel =
|
var viewModel =
|
||||||
DataService.GetLeafInputs()
|
(
|
||||||
.OrderByDescending(f => f.Id)
|
from li in DataService.GetLeafInputs()
|
||||||
.ToList()
|
where li.Added >= dateThreshold
|
||||||
|
orderby li.Id descending
|
||||||
|
select li
|
||||||
|
).ToList()
|
||||||
.Select(leafInput => new ResultItemViewModel(leafInput));
|
.Select(leafInput => new ResultItemViewModel(leafInput));
|
||||||
return View(viewModel);
|
return View(viewModel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<add namespace="System.Web.Mvc" />
|
<add namespace="System.Web.Mvc" />
|
||||||
<add namespace="System.Web.Mvc.Ajax" />
|
<add namespace="System.Web.Mvc.Ajax" />
|
||||||
<add namespace="System.Web.Mvc.Html" />
|
<add namespace="System.Web.Mvc.Html" />
|
||||||
|
<add namespace="System.Web.WebPages" />
|
||||||
<add namespace="System.Web.Optimization"/>
|
<add namespace="System.Web.Optimization"/>
|
||||||
<add namespace="System.Web.Routing" />
|
<add namespace="System.Web.Routing" />
|
||||||
<add namespace="Umbraco.Web" />
|
<add namespace="Umbraco.Web" />
|
||||||
|
|||||||
Reference in New Issue
Block a user