Skip to content

Rebind with implicit should reset existing binding #45

Open

Description

@JohanLarsson
kernel.Bind<I1, C>(() => throw new Exception("SHOULD NEVER GET HERE"));
kernel.Rebind<I1, C>();
var c = kernel.Get<C>();

Activity

  1. JohanLarsson commented on Dec 10, 2020

    @JohanLarsson
    MemberAuthor

    Don't think we can solve this ambiguity. Workaround is to rebind with explicit factory:

    kernel.Rebind<I1, C>(x => new C(...));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions