Example #1
0
        /// <summary>
        /// Sync the database with the email server.
        /// </summary>
        /// <returns>Task which syncs emails.</returns>
        public async Task SyncEmailsAsync()
        {
            IEnumerable <Email> emails = await _emailRetriever.GetLatestEmails();

            if (emails != null)
            {
                await _emailStorage.SaveEmails(emails);
            }
            else
            {
                Console.WriteLine("Error retrieving emails.");
            }
        }