Skip to content

Instantly share code, notes, and snippets.

@Kinani
Last active March 10, 2017 13:11
Show Gist options
  • Save Kinani/0526593dda059b2095877a7d3ead17eb to your computer and use it in GitHub Desktop.
Save Kinani/0526593dda059b2095877a7d3ead17eb to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net;
using System.Threading.Tasks;
using UltraReadingWeb.Models;
using UltraReadingWeb.Common;
namespace UltraReadingWeb.Controllers
{
public class UltraReadingController : Controller
{
[ActionName("Index")]
public async Task<ActionResult> IndexAsync()
{
var items = await DocDBRepo<UltraReading>.GetItemsAsync(r => r.Reading != string.Empty);
// Important: Not the best optimized way to do it, acutally it's very harmful to the user exprience.
// You may want to explore another option.
return View(items.Reverse().Take(15));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment