Skip to content

Depricate ExportInstance(delegate) methods in favor of ExportFactory<...> methods #89

Closed

Description

@ipjohnson

With the introduction of the ExportFactory method the ExportInstance(delegate) methods have become obsolete. As well as being obsolete the behavior is not consistent with how ExportInstance<T>(T value) and leads to confusion as seen in issue #86. With this in mind I'm going to mark the methods as obsolete in 6.2 and plan to remove them at some point later for a major version number release.

Activity

  1. added this to the 6.2.0 milestone on May 21, 2017
  2. darkcamper commented on May 25, 2017

    @darkcamper

    @ipjohnson How about adding an "ExportFuncWithContext" extension method (that maps to ExportFunc<IExportLocatorScope, StaticInjectionContext, IInjectionContext,T>) to IExportRegistrationBlock?

    I think it would make easier the transition from the obsolete ExportInstance method when you just want to do a context-base activation, and would provide design-time support for tools such as Resharper to suggest you the signature of the delegate.

  3. ipjohnson commented on May 25, 2017

    @ipjohnson
    OwnerAuthor

    @darkcamper sounds like a good idea, something like this?

    public static IFluentExportInstanceConfiguration<T> ExportFuncWithContext<T>(
         this IExportRegistrationBlock block, 
         Func<IExportLocatorScope, StaticInjectionContext, IInjectionContext,T> func)
    {
       return block.ExportFactory(func);
    }
    
  4. darkcamper commented on May 25, 2017

    @darkcamper

    @ipjohnson Yeah! That's exactly what I had in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions