Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
generik0 committed Dec 10, 2020
1 parent 5c7f535 commit 6d4d75e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static ComponentRegistration<TService> ScopedToNetServiceScope<TService>(
public static ComponentRegistration<TService> LifestyleNetTransient<TService>(this ComponentRegistration<TService> 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
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 6d4d75e

Please sign in to comment.