public ActionResult OverdueList() { var list = Using <GetOverdueRemindersForUser>().Execute(CurrentUserId); var reminders = from reminder in list let vehicle = Using <GetVehicleById>().Execute(CurrentUserId, reminder.VehicleId) let title = GetFullTitle(reminder, vehicle) select new OverdueReminderViewModel { FullTitle = title, Reminder = reminder }; var viewModel = new JsonRemindersOverdueListViewModel { Reminders = reminders.ToList() }; if (Request.IsAjaxRequest()) { if (Request.ContentType == "application/json") { return(Json(viewModel)); } } return(new EmptyResult()); }
public ActionResult OverdueList() { var list = Using <GetOverdueRemindersForUser>().Execute(CurrentUserId); var reminders = from reminder in list let vehicle = Using <GetVehicleById>().Execute(CurrentUserId, reminder.VehicleId) let title = GetFullTitle(reminder, vehicle) select new OverdueReminderViewModel { FullTitle = title, Reminder = reminder }; var viewModel = new JsonRemindersOverdueListViewModel { Reminders = reminders.ToList() }; return(Json(viewModel)); }