using System.Web; using DR.FV2016.Web.Models.Candidate; namespace DR.FV2016.Web.ViewModelProviders { public static class PlaceholderViewModelProvider { public static CandidateArticleList GetTopBandCandidates(int requestIndex) { int numPages = 2; int page = (requestIndex % numPages) + 1; string path = string.Format("/topbandcandidates-page-{0}.json", page); return DeserializeViewModelFromPath(path); } private static T DeserializeViewModelFromPath(string relativePath) { string absolutePath = HttpContext.Current.Server.MapPath(string.Format("~/placeholderviewmodelproviderdata{0}", relativePath)); string content = System.IO.File.ReadAllText(absolutePath); return Newtonsoft.Json.JsonConvert.DeserializeObject(content); } } }