Beispiel #1
0
        public async Task <Team> ReadTeamAsync(string id)
        {
            try
            {
                var results = await TeamCollection.FindAsync(t => t.Id == id);

                return(results.First());
            }
            catch (TimeoutException e)
            {
                Log.Error("Received time out for reading team async => ", e);
                return(null);
            }
            catch (Exception e)
            {
                Log.Error("Failed to read team async => ", e);
                return(null);
            }
        }
Beispiel #2
0
        public async Task <List <Team> > TeamsAsync()
        {
            try
            {
                var teams = await TeamCollection.FindAsync(_ => true);

                return(teams.ToList());
            }
            catch (TimeoutException e)
            {
                Log.Error("Received time out for retrieving teams async => ", e);
                return(null);
            }
            catch (Exception e)
            {
                Log.Error("Failed to retrieve teams async => ", e);
                return(null);
            }
        }