Refactor DI setup with extension methods for modularity

Refactored dependency injection by introducing AddApplication and AddInfrastructure extension methods for service registration. Moved DbContext and AutoMapper setup out of Program.cs to improve modularity and reusability. Added required NuGet packages to .csproj files.
This commit is contained in:
OlgunR
2026-01-19 08:46:52 +01:00
parent 28bab05980
commit 8c31784a5a
5 changed files with 33 additions and 8 deletions

View File

@@ -0,0 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
namespace DbFirst.Application;
public static class DependencyInjection
{
public static IServiceCollection AddApplication(this IServiceCollection services)
{
services.AddAutoMapper(typeof(DependencyInjection).Assembly);
return services;
}
}