Skip to content

ImportMembers misses members on base classes #118

Description

@RandomEngy

When I've marked some members with the [Import] attribute and call ImportMembers(MembersThat.HaveAttribute<ImportAttribute>()) , it misses marked members on the base class.

It would be nice if it found members on the base class, and also had a way to automatically import marked members for all types, without needing to use ImportMembers on every registration.

Activity

  1. added this to the 6.3.0 milestone on Sep 8, 2017
  2. ipjohnson commented on Sep 8, 2017

    @ipjohnson
    Owner

    @RandomEngy I'll tighten up the logic this weekend to make sure base properties are injectable

    currently there is a c# extension for registration block ImportMembers that is container wide but it requires the type of the property.

    In theory you should be able to do

    container.Configure(c => c.ImportMembers<object>(MembersThat.HaveAttribute<ImportAttribute>()));

    but there again it uses the same logic so it more than likely is going to miss the base properties.

    Sorry about this I'll make sure it's included in this weekends release.

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions