Skip to content

Commit

Permalink
Merge pull request #44 from hadashiA/ku/fix-lifetime-scope-registration
Browse files Browse the repository at this point in the history
Make sure LifetimeScope can be resolve as base class
  • Loading branch information
hadashiA authored Nov 8, 2020
2 parents 523450a + 29664db commit 09b498c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void InstallTo(IContainerBuilder builder)
}
extraInstaller?.Install(builder);

builder.RegisterInstance(this);
builder.RegisterInstance<LifetimeScope>(this).AsSelf();
}

LifetimeScope GetRuntimeParent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace VContainer.Tests.Unity
{
class SampleLifetimeScope : LifetimeScope {}

public class LifetimeScopeTest
{
[Test]
Expand Down Expand Up @@ -33,7 +35,8 @@ public IEnumerator CreateChild()
builder.RegisterEntryPoint<SampleEntryPoint>(Lifetime.Scoped).AsSelf();
}))
{
parentLifetimeScope = new GameObject("LifetimeScope").AddComponent<LifetimeScope>();
parentLifetimeScope = new GameObject("SampleLifetimeScope")
.AddComponent<SampleLifetimeScope>();
}

yield return null;
Expand Down

0 comments on commit 09b498c

Please sign in to comment.