Exemplo n.º 1
0
        public HttpResponseMessage GetSimilarCampaigns(HttpRequestMessage request, int campaignId)
        {
            var campaigns = _studentApi.GetSimilarCampaigns(campaignId);

            var campaignVm = CampaignViewModel.MultipleCampaignsMap(campaigns);

            foreach (var c in campaignVm)
            {
                var student = _studentApi.GetStudent(c.StudentId);
                c.Name    = student.Firstname;
                c.Surname = student.Surname;
            }

            var response = request.CreateResponse(HttpStatusCode.OK, campaignVm);

            return(response);
        }