public ActionResult ViewAvailability(Availability resource) { resource.AuthUrl = CronofyHelper.GetAccountIdAuthUrl(); if (ModelState.IsValid) { try { resource.AvailablePeriods = CronofyHelper.Availability(resource); } catch (CronofyResponseException ex) { resource.SetError(ex); } return(View("Index", resource)); } return(View("Index", resource)); }