public ActionResult Index() { ViewBag.Title = "Home Page"; var model = new HomeViewModel(); var htLogSvc = new HeightLogSvc(); model.Log = htLogSvc.GetRecentHeightLogs(10); model.CurrentHeight = model.Log.FirstOrDefault(); // model.Log = htLogSvc.GetPeriodHeightLogsPlusOneMore(new DateTime(2015, 06, 07), new DateTime(2015, 06, 07, 23, 59, 59)); return(View(model)); }
/// <summary> /// Triggered via Service Bus Queue, this function takes the message and records the contained info in the height log database /// </summary> /// <param name="message"></param> /// <param name="logger"></param> public static void ProcessQueueMessage( [ServiceBusTrigger("robotdeskheightchangequeue")] BrokeredMessage message, TextWriter logger) { logger.WriteLine("got message!"); string json = null; using (Stream stream = message.GetBody <Stream>()) using (TextReader reader = new StreamReader(stream)) { json = reader.ReadToEnd(); } logger.WriteLine("Received message: " + json); HeightLog height = null; height = JsonToHeightLog(json); var svc = new HeightLogSvc(); svc.SaveHeightLogEntry(height); }
// GET: Log public ActionResult Index() { var htLogSvc = new HeightLogSvc(); return(View(htLogSvc.GetRecentHeightLogs(100))); }