public IEntityFrameworkBuilder EnableAutoMigrations() { if (_wasCreated) { throw new Exception("Can not use EnableAutoMigrations with EnableAutoCreation!"); } if (_wasMigrated) { return(this); } foreach (var context in _service.GetDbContexts(_plugin)) { _logger.LogDebug( $"\"{_plugin.Name}\": \"{context.GetType().Name}\" migarting."); _service.Migrate(_plugin, context); } _wasMigrated = true; return(this); }