コード例 #1
0
        public HttpResponseMessage GetInactiveCampaigns(HttpRequestMessage request, int userId)
        {
            var campaigns = _studentApi.GetInactiveCampaigns(userId);

            var campaignVm = CampaignViewModel.MultipleCampaignsMap(campaigns);

            var student = _studentApi.GetStudent(userId);

            foreach (var model in campaignVm)
            {
                model.Name    = student.Firstname;
                model.Surname = student.Surname;
            }

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

            return(response);
        }