Beispiel #1
0
        public async Task <string> GetAlbumIdAsync()
        {
            var album = ambientFuckeryDatabase.Query <Album>().SingleOrDefault();

            if (album != null)
            {
                return(album.Id);
            }

            album = await CreateAlbumAsync();

            ambientFuckeryDatabase.Insert(album);
            return(album.Id);
        }
Beispiel #2
0
        private async Task <GoogleCredentials> GetCredentialsAsync()
        {
            var credentials = database.Query <GoogleCredentials>().FirstOrDefault();

            if (credentials != null)
            {
                return(credentials);
            }

            credentials = await PerformOAuthAsync();

            database.Insert(credentials);

            return(credentials);
        }