public ActionResult <IEnumerable <string> > Stats(int id) { try { StatsVM stats = new StatsVM(); var poll = _pollService.GetById(id); if (poll == null) { return(NotFound()); } stats.Views = poll.Views; stats.votes = _optionService.GetOptionStats(id); return(Ok(stats)); } catch (Exception e) { return(BadRequest(e.Message)); throw; } }
// // GET: /Home/Stats public ActionResult Stats() { StatsVM svm = new StatsVM(_adminBLL.ViewListByPage(), _adminBLL.ViewListByDate(), _adminBLL.ViewListByType()); return(View("Stats", svm)); }
public Stats() { ViewModel = new StatsVM(); InitializeComponent(); }