/// <summary> /// Syncs all tables. /// </summary> /// <returns>The all async.</returns> /// <param name="syncUserSpecific">If set to <c>true</c> sync user specific.</param> public async Task <bool> SyncAllAsync(bool syncUserSpecific) { if (!IsInitialized) { await InitializeAsync(); } var taskList = new List <Task <bool> >(); taskList.Add(CategoryStore.SyncAsync()); taskList.Add(MiniHacksStore.SyncAsync()); taskList.Add(NotificationStore.SyncAsync()); taskList.Add(SpeakerStore.SyncAsync()); taskList.Add(SessionStore.SyncAsync()); taskList.Add(SponsorStore.SyncAsync()); taskList.Add(EventStore.SyncAsync()); if (syncUserSpecific) { taskList.Add(FeedbackStore.SyncAsync()); taskList.Add(FavoriteStore.SyncAsync()); } var successes = await Task.WhenAll(taskList).ConfigureAwait(false); return(successes.Any(x => !x));//if any were a failure. }
/// <summary> /// Drops all tables from the database and updated DB Id /// </summary> /// <returns>The everything async.</returns> public Task DropEverythingAsync() { Settings.UpdateDatabaseId(); CategoryStore.DropTable(); EventStore.DropTable(); MiniHacksStore.DropTable(); NotificationStore.DropTable(); SessionStore.DropTable(); SpeakerStore.DropTable(); SponsorStore.DropTable(); FeedbackStore.DropTable(); FavoriteStore.DropTable(); IsInitialized = false; return(Task.FromResult(true)); }