コード例 #1
0
ファイル: ProfileController.cs プロジェクト: Ferido07/inisra
        // GET: Profile/Details
        public async Task <ActionResult> Details()
        {
            var       jobSeekerUser = (JobSeekerUser)(await UserManager.FindByIdAsync(User.Identity.GetUserId()));
            JobSeeker jobSeeker     = await bll.GetJobSeekerById(jobSeekerUser.JobSeekerID.Value);

            //just in case but almost never happens
            if (jobSeeker == null)
            {
                return(HttpNotFound());
            }
            return(View(jobSeeker));
        }
コード例 #2
0
        public async Task <IHttpActionResult> GetJobSeeker(int jobSeekerId)
        {
            JobSeeker jobSeeker = await bll.GetJobSeekerById(jobSeekerId);

            if (jobSeeker == null)
            {
                return(NotFound());
            }
            var dto = AutoMapper.Mapper.Map <JobSeeker, JobSeekerDto>(jobSeeker);

            return(Ok(dto));
        }
コード例 #3
0
        // GET: JobSeekers/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var jobSeeker = await bll.GetJobSeekerById(id.Value);

            if (jobSeeker == null)
            {
                return(HttpNotFound());
            }
            var dto = AutoMapper.Mapper.Map <JobSeeker, JobSeekerDto>(jobSeeker);

            return(View(dto));
        }