File: Program.cs
Web Access
Project: src\playground\DatabaseMigration\DatabaseMigration.MigrationService\DatabaseMigration.MigrationService.csproj (DatabaseMigration.MigrationService)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using DatabaseMigration.MigrationService;
using Microsoft.EntityFrameworkCore;
 
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHostedService<ApiDbInitializer>();
 
builder.AddServiceDefaults();
 
builder.Services.AddOpenTelemetry()
    .WithTracing(tracing => tracing.AddSource(ApiDbInitializer.ActivitySourceName));
 
builder.AddSqlServerDbContext<MyDb1Context>("db1");
 
var app = builder.Build();
 
app.Run();