Exemple #1
0
        /// <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);
        }
Exemple #2
0
 /// <summary> method "Down", removing data after "Up" and "Seed"</summary>
 protected virtual void Down(MigrationBuilderEnsured migrationBuilder)
 {
 }
Exemple #3
0
 /// <summary> method "Up" calling migration </summary>
 protected abstract void Up(MigrationBuilderEnsured migrationBuilder);
Exemple #4
0
 /// <summary> method "Init", called before "Up" </summary>
 protected virtual void Init(MigrationBuilderEnsured migrationBuilder, IServiceProvider serviceProvider)
 {
 }
Exemple #5
0
 /// <summary> Setup migrations </summary>
 protected sealed override void Up(MigrationBuilder migrationBuilder)
 {
     _migrationBuilder = new MigrationBuilderEnsured(migrationBuilder);
     this.OnSetUp(_migrationBuilder);
 }