Limit results
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user