public ActionResult Index()
        {
            var viewmodel = new AdminViewModel
                                {
                                    Milestones =
                                        Mapper.Map<IEnumerable<Milestone>, IEnumerable<MilestoneViewModel>>(
                                            _unitOfWork.Milestones.Get()),
                                            CustomProfile =  CustomProfile.GetProfile(Profile.UserName),
                                };

            return View(viewmodel);
        }
        public ActionResult Milestone(Guid milestoneId, Guid? stepId)
        {
            var viewModel = new AdminViewModel
            {
                Milestones =
                    Mapper.Map<IEnumerable<Milestone>, IEnumerable<MilestoneViewModel>>(
                        _unitOfWork.Milestones.Get()),
                Steps = Mapper.Map<IEnumerable<Step>, IEnumerable<StepViewModel>>(
                        _unitOfWork.Steps.Get(s => s.MilestoneId == milestoneId).OrderBy(s => s.DisplayOrder)),

            };

            viewModel.SelectedMilestone = viewModel.Milestones.FirstOrDefault(m => m.MilestoneId == milestoneId);
            viewModel.SelectedStep = stepId == null ? viewModel.Steps.First() : viewModel.Steps.FirstOrDefault(s => s.StepId == stepId);
            return View(viewModel);
        }
 public ActionResult Milestone(AdminViewModel viewModel)
 {
     var entityToUpdate = _unitOfWork.Steps.GetById(viewModel.SelectedStep.StepId);
     entityToUpdate.Guidance = viewModel.SelectedStep.Guidance;
     _unitOfWork.Steps.Update(entityToUpdate);
     _unitOfWork.Commit();
     return View(viewModel);
 }