/// <summary>
        /// Gets the applied changes already in the database
        /// </summary>
        /// <returns>
        /// A dictionary containing the change logs and the ids for those change logs
        /// </returns>
        public IDictionary <int, IChangeLog> GetAppliedChanges()
        {
            if (log.IsDebugEnabled)
            {
                log.Debug(LogUtility.GetContext());
            }

            IDictionary <int, IChangeLog> result = new ConcurrentDictionary <int, IChangeLog>();

            this.EnsureChangelogExists();

            DataSet changeLogDataSet = this.GetChangelog();

            // we're assuming that this will return a single table.  Can't be sure what the name will be so using the index.
            foreach (DataRow row in changeLogDataSet.Tables[0].Rows)
            {
                IChangeLog changeLog = new ChangeLog();
                changeLog.Parse(row);
                result.Add(changeLog.ChangeNumber, changeLog);
            }

            if (log.IsDebugEnabled)
            {
                log.Debug(LogUtility.GetResult(result));
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the applied changes already in the database
        /// </summary>
        /// <returns>A dictionary containing the change logs and the ids for those change logs</returns>
        public IDictionary <decimal, IChangeLog> GetAppliedChanges()
        {
            IDictionary <decimal, IChangeLog> result = new ConcurrentDictionary <decimal, IChangeLog>();

            this.EnsureChangelogExists();

            DataSet changeLogDataSet = this.GetChangelog();

            // we're assuming that this will return a single table.  Can't be sure what the name will be so using the index.
            foreach (DataRow row in changeLogDataSet.Tables[0].Rows)
            {
                IChangeLog changeLog = new ChangeLog();
                changeLog.Parse(row);
                result.Add(changeLog.ChangeNumber, changeLog);
            }

            return(result);
        }