/// <summary> On setup migrations </summary> private void OnSetUp(MigrationBuilderEnsured migrationBuilder) { using var initServiceScope = GeneralContext.CreateServiceScope(); var initServiceProvider = initServiceScope.ServiceProvider; this.Init(migrationBuilder, initServiceProvider); this.Up(migrationBuilder); this.Down(migrationBuilder); }
/// <summary> method "Down", removing data after "Up" and "Seed"</summary> protected virtual void Down(MigrationBuilderEnsured migrationBuilder) { }
/// <summary> method "Up" calling migration </summary> protected abstract void Up(MigrationBuilderEnsured migrationBuilder);
/// <summary> method "Init", called before "Up" </summary> protected virtual void Init(MigrationBuilderEnsured migrationBuilder, IServiceProvider serviceProvider) { }
/// <summary> Setup migrations </summary> protected sealed override void Up(MigrationBuilder migrationBuilder) { _migrationBuilder = new MigrationBuilderEnsured(migrationBuilder); this.OnSetUp(_migrationBuilder); }