From ca563f1d0c8edd2a67baa40ea78fc2c543514016 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 16 Jan 2026 13:45:15 +0100 Subject: [PATCH] Register DbContext and AutoMapper with DI, add TODOs Added ApplicationDbContext and AutoMapper registrations to the DI container in Program.cs. Included TODO comments to extract these registrations into extension methods for better reuse across projects. --- DbFirst.API/Program.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DbFirst.API/Program.cs b/DbFirst.API/Program.cs index aea4bfd..cfb6fc7 100644 --- a/DbFirst.API/Program.cs +++ b/DbFirst.API/Program.cs @@ -23,9 +23,11 @@ builder.Services.AddCors(options => }); }); +// TODO: Create extension method for this in Infrastructure layer in case of using in multiple projects builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); +// TODO: Create extension method for this in Application layer in case of using in multiple projects builder.Services.AddAutoMapper(typeof(CatalogProfile).Assembly, typeof(ApplicationDbContext).Assembly); builder.Services.AddScoped();