Beispiel #1
0
        private IList <Migration> LoadMigrationsIfNotLoaded()
        {
            if (_migrations != null)
            {
                return(_migrations);
            }

            List <Migration> migrations;

            lock (_migrationsResolver)
            {
                if (_migrations != null)
                {
                    return(_migrations);
                }

                migrations = _migrationsResolver.Resolve()
                             .OrderBy(x => x.Version)
                             .ToList();

                _latestSchemaVersion = migrations.Any() ? migrations.Max(x => x.Version) : 0;
                _migrations          = migrations;
            }

            Interceptor?.DetectedMigrations(migrations.ToArray(), _latestSchemaVersion);
            return(_migrations);
        }
Beispiel #2
0
        private void LoadMigrationsIfNotLoaded()
        {
            if (Migrations != null)
            {
                return;
            }

            lock (_migrationsResolver)
            {
                if (Migrations != null)
                {
                    return;
                }

                Migrations = _migrationsResolver.Resolve()
                             .OrderBy(x => x.Version)
                             .ToList();

                LatestSchemaVersion = Migrations.Any() ? Migrations.Max(x => x.Version) : 0;
            }

            Interceptor?.DetectedMigrations(Migrations.ToArray(), LatestSchemaVersion);
        }