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.
13 lines
318 B
C#
13 lines
318 B
C#
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;
|
|
}
|
|
}
|