public ActionResult Index() { int id = Convert.ToInt32(HttpContext.Session["userID"]); UserProfileViewModel userProfileViewModel = new UserProfileViewModel(); User user; List <Project> myProjectsAsOwner; List <Project> myProjectsAsWorker; user = _userDal.GetUser(id); myProjectsAsOwner = _projectDal.GetByOwnerId(id); myProjectsAsWorker = _projectDal.GetByWorkerId(id); userProfileViewModel.User = user; userProfileViewModel.MyProjectsAsOwner = myProjectsAsOwner; userProfileViewModel.MyProjectsAsWorker = myProjectsAsWorker; return(View(userProfileViewModel)); }
public IHttpActionResult GetByWorkerId(int workerId) { List <Project> projects = projectDal.GetByWorkerId(workerId); if (projects != null) { return(Ok(projects)); } else { return(NotFound()); } }