Skip to content

Startup Configuration

Furkan Güngör edited this page Dec 22, 2021 · 3 revisions

Usage

Dotnet 5

Initalize Startup configuration.

services.AddIronHook(options =>
{
    options.UseNpgsql(Configuration.GetConnectionString("Default"), opts => opts.UseIronHookNpgsqlMigrations());
});

after

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
   app.MigrateIronHook();
  // ...
}

Dotnet 6

Initalize Program configuration.

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddIronHook(opts =>
{
    opts.UseNpgsql(
        builder.Configuration.GetConnectionString("Default"),
        opts =>opts.UseIronHookNpgsqlMigrations()
        );
});

var app = builder.Build();

app.MigrateIronHook();

Now you can start hook operations.

Next Page

Clone this wiki locally