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:
parent
23a1008a31
commit
aefa676d62
|
|
@ -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 =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue