Closed ipjohnson closed 7 years ago
@ipjohnson How about adding an "ExportFuncWithContext
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.
@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);
}
@ipjohnson Yeah! That's exactly what I had in mind.
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.