public ActionResult Progress(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var userProgressDto = _vUserProgressService.GetByUserId(id.Value); var user = _vUserProfileService.GetById(id.Value); var vUserProgressesListViewModel = new VUserProgressesListViewModel( _mapper.Map <VUserProfileDTO, VUserProfileViewModel>(user), _mapper.Map <IEnumerable <VUserProgressDTO>, IEnumerable <VUserProgressViewModel> >(userProgressDto) ); return(PartialView(vUserProgressesListViewModel)); }
public ActionResult Index(int?id) { if (!id.HasValue) { // TODO: create my own badRequest method return(HttpNotFound()); } var _userProfile = _userProfileService.GetById(id.Value); var userProfile = _mapper.Map <VUserProfileDTO, VUserProfileViewModel>(_userProfile); var _userProgress = _userProgressService.GetByUserId(id.Value); var userProgress = _mapper.Map <IEnumerable <VUserProgressDTO>, IEnumerable <VUserProgressViewModel> >(_userProgress); var userProgresses = new VUserProgressesListViewModel(userProfile, userProgress); return(View(userProgresses)); }