public async Task <T> Get <T>(string url) { string content; if (containsAlbumId(url)) { content = MockDataFactory.GetAllMockDataAsStringByAlbumId(GetAlbumIdFromUrlAsInt(url)); } else { content = MockDataFactory.GetAllMockDataAsString(); } return(await Task.Run(() => JsonConvert.DeserializeObject <T>(content))); }
public HttpResponseMessage Get(string url) { HttpResponseMessage httpResponseMessage = new HttpResponseMessage(); string content; if (containsAlbumId(url)) { content = MockDataFactory.GetAllMockDataAsStringByAlbumId(GetAlbumIdFromUrlAsInt(url)); } else { content = MockDataFactory.GetAllMockDataAsString(); } httpResponseMessage.Content = new StringContent(content); return(httpResponseMessage); }