Exemple #1
0
        private static async ValueTask AddTrustedDependenciesAsync(IDependencyManager dependencyManager, CancellationToken cancellationToken = default)
        {
            IAppSettingsFacade  appSettingsFacade;
            AssemblyInformation assemblyInformation;

            if ((object)dependencyManager == null)
            {
                throw new ArgumentNullException(nameof(dependencyManager));
            }

            appSettingsFacade   = AppSettingsFacade.Default;
            assemblyInformation = AssemblyInformation.Default;

            await dependencyManager.AddResolutionAsync <IAppSettingsFacade>(string.Empty, false, new SingletonWrapperDependencyResolution <IAppSettingsFacade>(new InstanceDependencyResolution <IAppSettingsFacade>(appSettingsFacade)), cancellationToken);

            await dependencyManager.AddResolutionAsync <AssemblyInformation>(string.Empty, false, new SingletonWrapperDependencyResolution <AssemblyInformation>(new InstanceDependencyResolution <AssemblyInformation>(assemblyInformation)), cancellationToken);
        }
Exemple #2
0
        public static async ValueTask OnDependencyMagicAsync(IDependencyManager dependencyManager, CancellationToken cancellationToken = default)
        {
            if ((object)dependencyManager == null)
            {
                throw new ArgumentNullException(nameof(dependencyManager));
            }

            await dependencyManager.AddResolutionAsync <SolderExeApp>(string.Empty, false, new SingletonWrapperDependencyResolution <SolderExeApp>(new TransientActivatorAutoWiringDependencyResolution <SolderExeApp>()), cancellationToken);
        }