public ActionResult Details(int id) { var viewModel = mService.GetClass(id); viewModel.ClassLength = mService.CalculateClassLength(viewModel.StartTime, viewModel.EndTime); return(View(viewModel)); }