public IActionResult Edit(Guid id) { // Get the holiday from the EmployeeManagement var holiday = _employee.GetById(id); // build the view model var holidayViewModel = new HolidayViewModel() { FromDate = holiday.FromDate, ToDate = holiday.ToDate, HolidayName = holiday.HolidayName, Comments = holiday.Comments, HolidayId = id }; // send the view model ViewBag.IsEditing = true; return(View("Form", holidayViewModel)); }