public async Task <FocusItemWithExternalData> Get(string userId, string id) { var item = await _focusStore.Get(userId, id); if (null == item) { return(null); } return(new FocusItemWithExternalData() { CalendarEvent = null == item.CalendarEventId && null == item.CalendarEventFeedId ? null : await _calendarServiceClient.Users[userId].Feeds[item.CalendarEventFeedId].Events.Get(item.CalendarEventId), Directions = null == item.DirectionsMetadata ? null : (await _travelServiceClient.Directions[item.DirectionsMetadata.Key].GetAsync()).TransitDirections, DirectionsMetadata = item.DirectionsMetadata, End = item.End, Id = item.Id, IndicateTime = item.IndicateTime, Start = item.Start }); }
public async Task <IActionResult> Get(string id) { var item = await focusStore.Get(User.GetId(), id); return(Ok(item)); }