public ActionResult JobAd(Guid jobAdId) { var member = CurrentMember; var jobAd = _memberJobAdViewsQuery.GetMemberJobAdView(member, jobAdId); if (jobAd == null) { return(NotFound("job ad", "id", jobAdId)); } // Check the status of the job ad. var result = CheckStatus(jobAd); if (result != null) { return(result); } // Check url. result = EnsureUrl(jobAd.GenerateJobAdUrl()); if (result != null) { return(result); } // Do some initial checks. var jobPoster = _employersQuery.GetEmployer(jobAd.PosterId); if (jobPoster == null) { return(NotFound("job poster", "id", jobAd.PosterId)); } // Need to check that this job ad is allowed to be seen through a community portal. result = CheckCommunity(jobAd, jobPoster, member); if (result != null) { return(result); } var model = GetJobAdModel(member, jobAd, jobPoster); model.VisitorStatus = Prompts.GetVisitorStatus(member); return(View(model)); }