I just posted an answer to your SO question that utilizes the TypedFactoryFacility and a custom TypedComponentSelector:
http://stackoverflow.com/questions/7651390/delayed-lazy-resolve --- Patrick Steele http://weblogs.asp.net/psteele On Fri, Oct 7, 2011 at 2:42 AM, smolesen <[email protected]> wrote: > Hi > > Just saw a session fro NDC2011 with Krzysztof Kozmic (http:// > ndc2011.macsimum.no/mp4/Day3%20Friday/Track5%201340-1440.mp4) where > he's using Func<> to Lazy resolve the dependency, so what I'd really > would like, is to do something like: > > public class MyService > { > private IMyContext context; > private readonly Func<IMyExporter> exporterfactory; > public MyService(IMyContext context, Func<IMyExporter> > exporterfactory) > { > this.context = context; > this.exporterfactory = exporterfactory; > } > > public string Extractdata() > { > var exporter=exporterfactory(); > return exporter.Export(); > } > } > > However I would like to control what kind of exporter the > exporterfactory returns..... > > Søren > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
