Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Mar 12, 2022
1 parent a675880 commit 1ca0d6e
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/StashboxContainer.Resolver.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Stashbox.Exceptions;
using Stashbox.Expressions;
using Stashbox.Expressions;
using Stashbox.Resolution;
using Stashbox.Utils;
using System;
Expand All @@ -15,23 +14,11 @@ public partial class StashboxContainer
{
/// <inheritdoc />
public object? Resolve(Type typeFrom, bool nullResultAllowed, object[]? dependencyOverrides = null) =>
nullResultAllowed
? dependencyOverrides == null
? this.ResolveOrDefault(typeFrom)
: this.ResolveOrDefault(typeFrom, dependencyOverrides)
: dependencyOverrides == null
? this.Resolve(typeFrom)
: this.Resolve(typeFrom, dependencyOverrides);
this.rootScope.Resolve(typeFrom, nullResultAllowed, dependencyOverrides);

/// <inheritdoc />
public object? Resolve(Type typeFrom, object name, bool nullResultAllowed, object[]? dependencyOverrides = null) =>
nullResultAllowed
? dependencyOverrides == null
? this.ResolveOrDefault(typeFrom, name)
: this.ResolveOrDefault(typeFrom, name, dependencyOverrides)
: dependencyOverrides == null
? this.Resolve(typeFrom, name)
: this.Resolve(typeFrom, name, dependencyOverrides);
this.rootScope.Resolve(typeFrom, name, nullResultAllowed, dependencyOverrides);

/// <inheritdoc />
public object Resolve(Type typeFrom)
Expand Down

0 comments on commit 1ca0d6e

Please sign in to comment.