public HttpResponseMessage GetStudentsApplying(HttpRequestMessage request, int sponsorshipId) { var students = _sponsorApi.GetStudentsApplying(sponsorshipId); var s = StudentViewModel.MapMultipleStudents(students); var response = request.CreateResponse(HttpStatusCode.OK, s); return(response); }
public HttpResponseMessage GetSponsorshipSuggestions(HttpRequestMessage request, int studentId) { var suggestions = _studentApi.LoadSponsorshipSuggestions(studentId); var sponsorshipsVm = SponsorshipViewModel.MultipleSponsorshipsMap(suggestions); foreach (var sponsorship in sponsorshipsVm) { sponsorship.ApplicantCount = _sponsorApi.GetStudentsApplying(sponsorship.ID).Count; sponsorship.SponsorPicturePath = _sponsorApi.GetUserInfo(sponsorship.SponsorId).ProfilePicturePath; } var response = request.CreateResponse(HttpStatusCode.OK, sponsorshipsVm); return(response); }