示例#1
0
        public virtual IReadOnlyList <HistoryRow> GetAppliedMigrations()
        {
            var rows = new List <HistoryRow>();

            if (Exists())
            {
                _connection.Open();
                try
                {
                    using (var reader = _executor.ExecuteReader(_connection, GetAppliedMigrationsSql))
                    {
                        while (reader.Read())
                        {
                            rows.Add(new HistoryRow(reader.GetString(0), reader.GetString(1)));
                        }
                    }
                }
                finally
                {
                    _connection.Close();
                }
            }

            return(rows);
        }