Skip to content
Permalink
1d5d09bae4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
33 lines (28 sloc) 1.01 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TeamDBAwesome.SqlService;
using TeamDBAwesome.Models;
using Newtonsoft.Json;
namespace TeamDBAwesome.Controllers
{
public class GetOrderTracksController : ApiController
{
public HttpResponseMessage Get(int orderId)
{
MySqlService dbService = new MySqlService();
List<Track> trackList = dbService.getOrderTracks(orderId);
foreach(Track track in trackList)
{
track.url = "http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a";
}
string serialzed = JsonConvert.SerializeObject(trackList);
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK);
message.Content = new StringContent(serialzed);
return message;
}
}
}