Skip to content

Commit

Permalink
Rename CurrentOrThrow to Current
Browse files Browse the repository at this point in the history
  • Loading branch information
generik0 committed Dec 10, 2020
1 parent c12a810 commit ecfa403
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ExtensionContainerRootScopeAccessor : IScopeAccessor
{
public ILifetimeScope GetScope(CreationContext context)
{
return ExtensionContainerScope.CurrentOrThrow.RootScope ?? throw new InvalidOperationException("No root scope available");
return ExtensionContainerScope.Current.RootScope ?? throw new InvalidOperationException("No root scope available");
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Castle.Windsor.Extensions.DependencyInjection.Scope

internal class ExtensionContainerScope : ILifetimeScope, IDisposable
{
internal static ExtensionContainerScope CurrentOrThrow
internal static ExtensionContainerScope Current
{
get => current.Value ?? throw new InvalidOperationException("No scope available");
set => current.Value = value;
Expand All @@ -44,7 +44,7 @@ protected ExtensionContainerScope(ExtensionContainerScope parent)

internal static ExtensionContainerScope BeginScope()
{
var scope = new ExtensionContainerScope(CurrentOrThrow);
var scope = new ExtensionContainerScope(Current);
current.Value = scope;
return scope;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ExtensionContainerScopeAccessor : IScopeAccessor
{
public ILifetimeScope GetScope(CreationContext context)
{
return ExtensionContainerScope.CurrentOrThrow ?? throw new InvalidOperationException("No scope available");
return ExtensionContainerScope.Current ?? throw new InvalidOperationException("No scope available");
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ internal class ForcedScope : IDisposable
private readonly ExtensionContainerScope previousScope;
internal ForcedScope(ExtensionContainerScope scope)
{
previousScope = ExtensionContainerScope.CurrentOrThrow;
ExtensionContainerScope.CurrentOrThrow = scope;
previousScope = ExtensionContainerScope.Current;
ExtensionContainerScope.Current = scope;
}
public void Dispose()
{
ExtensionContainerScope.CurrentOrThrow = previousScope;
ExtensionContainerScope.Current = previousScope;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class WindsorScopedServiceProvider : IServiceProvider, ISupportRequired
public WindsorScopedServiceProvider(IWindsorContainer container)
{
this.container = container;
scope = ExtensionContainerScope.CurrentOrThrow;
scope = ExtensionContainerScope.Current;
}

public object GetService(Type serviceType)
Expand Down

0 comments on commit ecfa403

Please sign in to comment.