示例#1
0
        /// <summary>
        /// Configures the database instance.
        /// </summary>
        /// <returns></returns>
        private async Task <bool> ConfigureDatabaseAsync()
        {
            try
            {
                ClientDatabase = new SQLServerClientDatabase(CoreSettings.GetDatabaseConnectionString(), CoreLog, CoreSettings);
                await ClientDatabase.PrepareDatabaseAsync().ConfigureAwait(false);

                return(true);
            }
            catch (Exception ex)
            {
                var message = "Failed to configure client database.";
                var context = CoreLog.GenerateFullContextStackTrace();
                CoreLog.WriteSystemEvent(message, ex, context, ArchivialLibrary.Constants.EventIDs.FailedToPrepareClientDatabase, true);
                return(false);
            }
        }