fix(backend): Register IApplicationDbContext interface in DI container - BUG-006
Fixed critical P0 bug where application failed to start due to missing IApplicationDbContext registration in dependency injection container. Root Cause: - Sprint command handlers (CreateSprint, UpdateSprint, etc.) depend on IApplicationDbContext - PMDbContext implements IApplicationDbContext but interface was not registered in DI - ASP.NET Core DI validation failed at application startup Solution: - Added IApplicationDbContext interface registration in ModuleExtensions.cs - Maps interface to PMDbContext implementation using service provider Impact: - Application can now start successfully - All Sprint command handlers can resolve their dependencies - Docker container startup will succeed Testing: - Local build: SUCCESS - Docker build: PENDING QA validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,10 @@ public static class ModuleExtensions
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Register IApplicationDbContext interface (required by command handlers)
|
||||||
|
services.AddScoped<ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces.IApplicationDbContext>(
|
||||||
|
sp => sp.GetRequiredService<PMDbContext>());
|
||||||
|
|
||||||
// Register HTTP Context Accessor (for tenant context)
|
// Register HTTP Context Accessor (for tenant context)
|
||||||
services.AddHttpContextAccessor();
|
services.AddHttpContextAccessor();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user