1. mattgrande
  2. HamOntFire

Commits

mgr...@redwavecommerce.com  committed 5a84c45

Use index explicitly.

  • Participants
  • Parent commits abe2665
  • Branches default

Comments (1)

Files changed (1)

File HamOntFire.Web/Controllers/HomeController.cs

View file
  • Ignore whitespace
         {
             try
             {
-                var events = RavenSession.Query<Event>().Where(e => e.CreatedAt > DateTime.Now.AddHours(-3));
-                //var json = new StringBuilder();
+                var events = RavenSession.Query<Event>("Events/ByCreatedAtSortByCreatedAt")
+                    .Where(e => e.CreatedAt > DateTime.Now.AddHours(-3));
                 var list = new List<dynamic>();
 
                 foreach (Event @event in events)
                     dynamic dynamicEvent = @event.ToViewModel();
                     list.Add(dynamicEvent);
                 }
-                //json.Insert(0, "[");
-                //json.Append("]");
-
                 return Json(list, JsonRequestBehavior.AllowGet);
             }
             catch (Exception ex)