using Microsoft.WindowsAzure.MobileServices; using MyMVC.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MyMVC.Controllers { public class HomeController : Controller { List<TJamData> items = null; public ActionResult Jam() { takedata(); return View(items); } private async void takedata() { MobileServiceClient m_MobileService = new MobileServiceClient("https://staupilot.azure-mobile.net/", "yLitRKWFZcWLEErPeuThcoZhjXCyiV69"); IMobileServiceTable<TJamData> tJamTbl = m_MobileService.GetTable<TJamData>(); items = await tJamTbl.Take(500) .Where(todoItem => todoItem.IsActive == true) .ToListAsync(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MyMVC.Models { public class TJamData { public int Id { get; set; } public string HighwayName { get; set; } public string HighwayFrom { get; set; } public bool IsActive { get; set; } public string HighwayTo { get; set; } public string HighwayDirection { get; set; } public DateTime DateTime { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } public string OriginalMessage { get; set; } public string StartLocation { get; set; } public string EndLocation { get; set; } public float TrafficJamLength { get; set; } public string Provider { get; set; } public int JamMessageType { get; set; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)