Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitional Redirects will not work when resolved indirectly #70

Closed
smudge202 opened this issue May 22, 2015 · 1 comment · Fixed by #79
Closed

Transitional Redirects will not work when resolved indirectly #70

smudge202 opened this issue May 22, 2015 · 1 comment · Fixed by #79
Assignees
Labels
Milestone

Comments

@smudge202
Copy link
Collaborator

Can't believe this didn't surface yet!

Transitional behaviour works currently by redirecting GetService requests in accordance with the registered Transitions.

However, if you request a consumer of the transitional, a transitional will not be injected!

public interface IFoo { }
public class Foo : IFoo { }

public class Bar
{
  public Bar(IFoo foo) 
  { 
    // this is a normal foo, that cannot be transitioned!!
  }
}

services.AddTransient<IFoo, Foo>().AsTransitional();
services.AddTransient<Bar, Bar>();

var bar = app.GetService<Bar>();
// bar will contain an untransitional Bar
@smudge202
Copy link
Collaborator Author

This has been resolved as part of the structural change found here: 4com/compose#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant