Esempio n. 1
0
        public async Task <Session> GetSession(int sessionId)
        {
            var fetchAllSessions = _httpHelper.FetchSessions();
            var sessionDetails   = _httpHelper.FetchSession(sessionId);

            await Task.WhenAll(fetchAllSessions, sessionDetails);

            var session = fetchAllSessions.Result.SingleOrDefault(s => s.Id == sessionId);

            if (session == null)
            {
                throw new SessionNotFoundError();
            }

            session.Description = sessionDetails.Result.Result;
            return(session);
        }