Fix: Register GameLogicServices as transient

Scoped services can't be resolved from singleton (GameDefinitionRegistry).
Logic services are stateless, so transient is appropriate.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beo3000 2025-12-27 09:03:50 +01:00
parent 23a1008a31
commit aefa676d62
1 changed files with 3 additions and 3 deletions

View File

@ -139,9 +139,9 @@ public static class GameRegistrationExtensions
where TDefinition : class, IGameDefinition, new()
where TLogicService : class, IGameLogicService
{
// Register the logic service
services.AddScoped<TLogicService>();
services.AddScoped(typeof(TLogicService), typeof(TLogicService));
// Register the logic service as transient (stateless, can be resolved from singleton registry)
services.AddTransient<TLogicService>();
services.AddTransient(typeof(TLogicService), typeof(TLogicService));
// Register initializer to add definition to registry
services.AddTransient<IGameTypeInitializer>(sp =>