diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Extensions/WindsorExtensions.cs b/src/Castle.Windsor.Extensions.DependencyInjection/Extensions/WindsorExtensions.cs index 38e23c1759..38d46d34d7 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Extensions/WindsorExtensions.cs +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Extensions/WindsorExtensions.cs @@ -39,7 +39,7 @@ public static ComponentRegistration ScopedToNetServiceScope( public static ComponentRegistration LifestyleNetTransient(this ComponentRegistration registration) where TService : class { return registration - .Attribute(ExtensionContainerScope.TransientMarker).Eq(Boolean.TrueString) + .Attribute(ExtensionContainerScopeBase.TransientMarker).Eq(Boolean.TrueString) .LifeStyle.ScopedToNetServiceScope(); //.NET core expects new instances but release on scope dispose } diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeBase.cs b/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeBase.cs index 84001bc9bc..7c9683a2bf 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeBase.cs +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeBase.cs @@ -1,3 +1,17 @@ +// Copyright 2004-2020 Castle Project - http://www.castleproject.org/ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + namespace Castle.Windsor.Extensions.DependencyInjection.Scope { using System; @@ -6,7 +20,7 @@ namespace Castle.Windsor.Extensions.DependencyInjection.Scope using Castle.MicroKernel; using Castle.MicroKernel.Lifestyle.Scoped; - internal abstract class ExtensionContainerScopeBase : ILifetimeScope, IDisposable + internal abstract class ExtensionContainerScopeBase : ILifetimeScope { public static string TransientMarker = "Transient"; private readonly IScopeCache scopeCache; @@ -33,7 +47,7 @@ public Burden GetCachedInstance(ComponentModel model, ScopedInstanceActivationCa // Add transient's burden to scope so it gets released if (model.Configuration.Attributes.Get(TransientMarker) == bool.TrueString) { - var transientBurden = createInstance((_) => {}); + var transientBurden = createInstance(_ => {}); scopeCache[transientBurden] = transientBurden; return transientBurden; }