diff --git a/src/Trash/Command/Helpers/CacheStoragePath.cs b/src/Trash/Command/Helpers/CacheStoragePath.cs index 7c8f6008..dce23aa8 100644 --- a/src/Trash/Command/Helpers/CacheStoragePath.cs +++ b/src/Trash/Command/Helpers/CacheStoragePath.cs @@ -1,17 +1,16 @@ -using System; -using TrashLib.Cache; +using TrashLib.Cache; namespace Trash.Command.Helpers { public class CacheStoragePath : ICacheStoragePath { - private readonly Lazy _cmd; + private readonly IActiveServiceCommandProvider _serviceCommandProvider; - public CacheStoragePath(Lazy cmd) + public CacheStoragePath(IActiveServiceCommandProvider serviceCommandProvider) { - _cmd = cmd; + _serviceCommandProvider = serviceCommandProvider; } - public string Path => _cmd.Value.CacheStoragePath; + public string Path => _serviceCommandProvider.ActiveCommand.CacheStoragePath; } } diff --git a/src/Trash/CompositionRoot.cs b/src/Trash/CompositionRoot.cs index c5198f41..5838eddb 100644 --- a/src/Trash/CompositionRoot.cs +++ b/src/Trash/CompositionRoot.cs @@ -69,9 +69,6 @@ namespace Trash builder.RegisterType() .As() .SingleInstance(); - - builder.Register(c => c.Resolve().ActiveCommand) - .As(); } public static IContainer Setup()