public ActionResult Edit(Batch batch) { var entity = Mapper.Map <BatchEditVm>(batch); entity.Course = _batchManager.GetCourseById(entity.CourseId); entity.ParticipantSelectListItems = GetAllParticipantSlItems(); entity.TrainerSelectListItems = GetAllTrainersSlItems(); entity.ExamSelectListItems = GetAllExamSlItems(); entity.Trainers = _batchManager.GetTrainersByBatchId(entity.Id); entity.Participants = _batchManager.GetParticipantByBatchId(entity.Id); return(View(entity)); }