public InterviewFeedbackModel GetInterviewFeedbacks(int candidateId) { Candidates cand = GetCandidate(candidateId); InterviewFeedbackModel model = new InterviewFeedbackModel() { CandidateID = cand.CandidateID, CandidateName = cand.FirstName + " " + cand.LastName, TotalExperience = cand.TotalExperience, CurrentPosition = cand.CurrentTitle }; model.FeedbackRound1 = this.DataContext.GetInterviewFeedback(candidateId, 1); model.FeedbackRound2 = this.DataContext.GetInterviewFeedback(candidateId, 2); return(model); }
public HttpResponseMessage Get(int id) { try { InterviewFeedbackModel model = this._repo.GetInterviewFeedbacks(id); if (model != null) { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, model); return(response); } else { return(Request.CreateErrorResponse(HttpStatusCode.NoContent, new Exception("No input found to get data"))); } } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }