public async Task<Thing> GetThingById(string id)
{
//determine the type of the id (t1, t2, t3, t4)
//go check what we've got stored of that type for a matching id
if (id.Length > 2)
{
var idCode = id.Substring(0, 2);
Thing gottenThing = null;
switch (idCode)
{
//case "t1":
//gottenThing = await _offlineService.RetrieveComment(id);
//break;
case "t3":
gottenThing = await _offlineService.RetrieveLink(id);
break;
case "t5":
gottenThing = await _offlineService.RetrieveSubredditById(id);
break;
}
if (gottenThing == null)
return MaybeStoreThing(await _redditService.GetThingById(id));
else
return gottenThing;
}
return null;
}