public ActionResult LeapYearInput(LeapYearCalculatorModel request) { if (ModelState.IsValid) { var leapCalc = new LeapYearCalculator(); var leapData = new LeapYearRequest(); leapData.StartYear = request.StartYear.Value; leapData.EndYear = request.EndYear.Value; var result = leapCalc.FindLeapYear(leapData); return(View("LeapYearOutput", result)); } else { return(View(request)); } }
public ActionResult LeapYearInput() { var model = new LeapYearCalculatorModel(); return(View(model)); }