private void HandleNullContextError(ContainerRegistry containerRegistry) { var message = $"ContainerRegistry {containerRegistry} has null context!"; switch (NullContextReaction) { case LifeTimeReaction.NoReaction: break; case LifeTimeReaction.LogError: Log.Error(Tag, message); break; case LifeTimeReaction.ThrowException: throw new LifeTimeException(message); } }
private void HandleContextLifeTimeError(ContainerRegistry parentRegistry, ContainerRegistry childRegistry) { var message = $"Parent ContainerRegistry {parentRegistry} has context with lifetime {parentRegistry.Context.Lifetime}" + $" less or equal than child ContainerRegistry {childRegistry} with context lifetime {childRegistry.Context.Lifetime}"; switch (LifeTimeErrorReaction) { case LifeTimeReaction.NoReaction: break; case LifeTimeReaction.LogError: Log.Error(Tag, message); break; case LifeTimeReaction.ThrowException: throw new LifeTimeException(message); } }
public void Push(ContainerRegistry containerRegistry) { _stack.Add(containerRegistry); CheckLifeTime(); }
internal void AddRegistry(ContainerRegistry registry) { _containerRegistries.Add(registry); }