tag:autofac.uservoice.com,2008-02-07:/activityAutofac on UserVoice2012-01-16T15:53:32-08:00tag:autofac.uservoice.com,2008-02-07:Event/105674002012-01-16T15:53:32-08:002012-01-16T15:53:32-08:00WPF Walkthrough [updated]<p>Create an end-to-end walkthrough showing how to set up Autofac with Windows Presentation Foundation (WPF). Include a sample application.</p><p>mabster said:<br /><div class="typeset"><p>Comicster might serve as an example.</p>
<p><a href="http://comicster.net" rel="nofollow" target="_blank">http://comicster.net</a>
<br /><a href="https://bitbucket.org/mabster/comicster" rel="nofollow" target="_blank">https://bitbucket.org/mabster/comicster</a></p></div></p>mabstertag:autofac.uservoice.com,2008-02-07:Event/105613812012-01-15T20:24:39-08:002012-01-15T20:24:39-08:00add a HasKey method to IIndex<p>mabster suggested:<br />Currently if I want to determine if a class is registered with a specific key I have to use IsRegistered on the container, or TryGetValue on IIndex<TKey, TValue>. It'd be nice if IIndex had a HasKey(TKey key) method, returning bool, to simplify this test.</p>mabstertag:autofac.uservoice.com,2008-02-07:Event/99954192011-10-11T14:05:46-07:002011-10-11T14:05:46-07:00Support FSharpFunc<p>xepaul suggested:<br />Dynamic instantiation, and parameterisation is supported via func's, it would be very use if it was also supported via FSharpFunc's</p>xepaultag:autofac.uservoice.com,2008-02-07:Event/93846332011-08-09T06:20:58-07:002011-08-09T06:20:58-07:00Support Compact Framework (.NET CF) [updated]<p>Add a build configuration for .NET CF.</p><p>Don Konfetti said:<br /><div class="typeset"><p>There's no serious IoC container available for .NET CF. So, Autofac supporting .NET CF would be great!</p></div></p>Don Konfettitag:autofac.uservoice.com,2008-02-07:Event/89336312011-07-12T09:02:48-07:002011-07-12T09:02:48-07:00Extend XML Configuration [updated]<p>Most Autofac applications use code to register services, and where necessary register only Modules via XML.
Some users have expressed interest in adding more fine-grained component registration to the XML sytax:
Examples:
* Constructor selection policy
* Tags
* Factory Methods
* Open generic types
* Resolve named services as constructor parameters
</p><p>Tomek Pluskiewicz said:<br /><div class="typeset"><p>Please add to the list ability to configure constructor/property injection for components registered in code (this is a feature I used extensively in Windsor)</p></div></p>Tomek Pluskiewicztag:autofac.uservoice.com,2008-02-07:Event/47729792011-01-09T00:20:32-08:002011-01-09T00:20:32-08:00ASP.NET MVC integration demo in trunk [updated]<p>Andrew Ma said:<br /><div class="typeset"><p>there are files in /examples and /src/examples, my guess is the creator is asking to clean this up to have it in one location</p></div></p>Andrew Matag:autofac.uservoice.com,2008-02-07:Event/47729532011-01-09T00:18:50-08:002011-01-09T00:18:50-08:00Add a NuGet package for MVC3 integrationAndrew Matag:autofac.uservoice.com,2008-02-07:Event/45375872010-12-23T19:48:52-08:002010-12-23T19:48:52-08:00Utilize Expression Trees in RegisterType() to improve Resolve() performance [is now declined]<p>I've implemented a custom Attributes and Modules to enable attribute driven configuration (registration declarations). To improve Resolve() performance, my modules use reflection and expression trees to produce the construction delegates, registering them via RegisterCallback() instead of simply calling RegisterType. I believe RegisterType() could use similar logic to eliminate the current overhead during Resolve().</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/45375852010-12-23T19:48:52-08:002010-12-23T19:48:52-08:00Utilize Expression Trees in RegisterType() to improve Resolve() performance [updated]<p>I've implemented a custom Attributes and Modules to enable attribute driven configuration (registration declarations). To improve Resolve() performance, my modules use reflection and expression trees to produce the construction delegates, registering them via RegisterCallback() instead of simply calling RegisterType. I believe RegisterType() could use similar logic to eliminate the current overhead during Resolve().</p><p>nicholas.blumhardt (admin) responded:<br /><div class="typeset"><p>Thanks again.</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/45148152010-12-22T10:31:14-08:002010-12-22T10:31:14-08:00Utilize Expression Trees in RegisterType() to improve Resolve() performance [updated]<p>I've implemented a custom Attributes and Modules to enable attribute driven configuration (registration declarations). To improve Resolve() performance, my modules use reflection and expression trees to produce the construction delegates, registering them via RegisterCallback() instead of simply calling RegisterType. I believe RegisterType() could use similar logic to eliminate the current overhead during Resolve().</p><p>Kevin Meyer said:<br /><div class="typeset"><p>Thanks for the response. I took at look at the source and see what you mean. There's a bit more sophistication in the constructor parameter binding than I realized.</p>
<p>Very clean code, by the way.</p></div></p>Kevin Meyertag:autofac.uservoice.com,2008-02-07:Event/44627392010-12-19T14:13:11-08:002010-12-19T14:13:11-08:00Utilize Expression Trees in RegisterType() to improve Resolve() performance [updated]<p>I've implemented a custom Attributes and Modules to enable attribute driven configuration (registration declarations). To improve Resolve() performance, my modules use reflection and expression trees to produce the construction delegates, registering them via RegisterCallback() instead of simply calling RegisterType. I believe RegisterType() could use similar logic to eliminate the current overhead during Resolve().</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Thanks for the suggestion, Kevin. The dynamic nature of constructor resolution in Autofac makes this practically impossible - thankfully if you have a performance-sensitive scenarion, profile your app, and Autofac turns out to be significant, you usually find that 90% of instantiations are the same handful of components. Switching these to single-instance (crazy fast) or registering them with a lambda (just about as fast) is a simple way to eliminate reflection overhead.</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/29390492010-09-16T14:18:02-07:002010-09-16T14:18:02-07:00Move types like Meta<>, Owned<> to independent assembly [updated]<p>This would aid in the goal of Zero Intrusion (Components don't need to reference Autofac). It would allow components to be descriptive about their relationships without needing to reference the Autofac assembly.</p><p>Robert Hencke said:<br /><div class="typeset"><p>I'm sorry for the late reply. Sure, I'd be happy to.</p></div></p>Robert Hencketag:autofac.uservoice.com,2008-02-07:Event/26645832010-08-18T15:49:52-07:002010-08-18T15:49:52-07:00Add Support to create custom IScope [updated]<p>Currently it has the IScope but internally it uses the enum which restricts to create custom scope such as PerWebRequest. The current recommended way to create a child container is very similar to Unity but not like other container.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Howdy, It might be worth checking out HttpRequestScoped() in the Autofac.Integration.Web project. Autofac does allow creation of custom scopes, but the scope hierarchy has to be represented explicitly using child lifetimes scopes. Cheers!</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/26645632010-08-18T15:46:28-07:002010-08-18T15:46:28-07:00Move types like Meta<>, Owned<> to independent assembly [updated]<p>This would aid in the goal of Zero Intrusion (Components don't need to reference Autofac). It would allow components to be descriptive about their relationships without needing to reference the Autofac assembly.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Hi Robert,</p>
<p>I've kicked off some work to do with this - would you be interested in lending a hand? If so let me know and I'll add you to the (independent from Autofac) project.</p>
<p>Cheers,
<br />Nick</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/26645472010-08-18T15:44:53-07:002010-08-18T15:44:53-07:00Improved registration of types as their interfaces [updated]<p>I typically use a fair amount of interfaces to make testing/stubbing easier.
One slight pain I have with Autofac is registering a type .As() an interface it implements. Not a huge pain, but it would be nice to be able to write it much more cleanly.
At current I use reflection to do this. It would be nice instead if RegisterTypesFromAssembly() or RegisterTypesMatching() could be extended to do this. Something like:
RegisterTypesAssignableFrom(ICommand).AsInterface()
where AsInterface works out the interface the type implements directly. Bit messy but you get the idea.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Hi Robert,</p>
<p>We ended up with:</p>
<p>builder.RegisterAssemblyTypes()
<br /> .AssignableTo<ICommand>()
<br /> .AsImplementedInterfaces();</p>
<p>How does this go towards your original suggestion?</p>
<p>Cheers!
<br />Nick</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/26598552010-08-18T06:59:36-07:002010-08-18T06:59:36-07:00Move types like Meta<>, Owned<> to independent assembly<p>Robert Hencke suggested:<br />This would aid in the goal of Zero Intrusion (Components don't need to reference Autofac). It would allow components to be descriptive about their relationships without needing to reference the Autofac assembly.</p>Robert Hencketag:autofac.uservoice.com,2008-02-07:Event/23703052010-07-12T21:11:42-07:002010-07-12T21:11:42-07:00Support C# 4.0 optional parameters for constructor resolution [is now completed]nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/23703032010-07-12T21:11:42-07:002010-07-12T21:11:42-07:00Support C# 4.0 optional parameters for constructor resolution [updated]<p>nicholas.blumhardt (admin) responded:<br /><div class="typeset"><p>Done - see example on <a href="http://autofac.org" rel="nofollow" target="_blank">http://autofac.org</a>
<br /> - Default parameter values can be used to express optional dependencies (properties can be used instead if you prefer):</p>
<p>public TaskController(ITaskRepository tasks, ILog log = null)</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/23702952010-07-12T21:09:45-07:002010-07-12T21:09:45-07:00Registration conventions [is now completed]<p>Not really sure how to put this in words or if there's a real use case.
But was thinking of conventions that could be defined, and Autofac regsiters everything matching that convention. Sort of like FluentNHibernate's AutoMapping.
So for example, anything that implements a single interface, register it as that interface.
Or, anything such as Converter<UserDto, User> where there are two types, register it using the former type, ie IConverter<UserDto>
This would make registration simpler, and also you could unit test your convention checking that certain types have been registered.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/23702932010-07-12T21:09:45-07:002010-07-12T21:09:45-07:00Registration conventions [updated]<p>Not really sure how to put this in words or if there's a real use case.
But was thinking of conventions that could be defined, and Autofac regsiters everything matching that convention. Sort of like FluentNHibernate's AutoMapping.
So for example, anything that implements a single interface, register it as that interface.
Or, anything such as Converter<UserDto, User> where there are two types, register it using the former type, ie IConverter<UserDto>
This would make registration simpler, and also you could unit test your convention checking that certain types have been registered.</p><p>nicholas.blumhardt (admin) responded:<br /><div class="typeset"><p>Thanks all - this suggestion has been implemented as 'scanning registrations' via RegisterAssemblyTypes(). See <a href="http://code.google.com/p/autofac/wiki/Scanning" rel="nofollow" target="_blank">http://code.google.com/p/autofac/wiki/Scanning</a></p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/16788112010-04-02T19:31:44-07:002010-04-02T19:31:44-07:00Please come forth and suggest, folks! [is now none]<p>Autofac is waiting for your ideas :)</p>Anonymoustag:autofac.uservoice.com,2008-02-07:Event/11617862010-02-20T15:39:09-08:002010-02-20T15:39:09-08:00Resolve open generic interfaces by constraint [updated]<p>Support resolving open generics by the most specific constraint. For example:
class MyService<T> { }
class MyFooService<T> : MyService<T> where T : IFoo { }
b.Register<MyService<>>();
b.Register<MyFooService<>>().As<MyService<>>()
c.Resolve<MyService<object>>() // gets a MyService
c.Resolve<MyService<FooImplementor>>() // gets a MyFooService</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>From r779, Autofac 2 will verify open generic parameter constraints before providing a generic implementation (<a href="http://code.google.com/p/autofac/source/detail?r=779" rel="nofollow" target="_blank">http://code.google.com/p/autofac/source/detail?r=779</a>)</p>
<p>Which implementation is resolved depends on the order of registration though and not specificity of the constraint (interesting suggestion.)</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/11542402010-02-18T07:52:58-08:002010-02-18T07:52:58-08:00Resolve open generic interfaces by constraint<p>Ilia Jerebtsov suggested:<br />Support resolving open generics by the most specific constraint. For example:
class MyService<T> { }
class MyFooService<T> : MyService<T> where T : IFoo { }
b.Register<MyService<>>();
b.Register<MyFooService<>>().As<MyService<>>()
c.Resolve<MyService<object>>() // gets a MyService
c.Resolve<MyService<FooImplementor>>() // gets a MyFooService</p>Ilia Jerebtsovtag:autofac.uservoice.com,2008-02-07:Event/11377022010-02-12T08:43:04-08:002010-02-12T08:43:04-08:00"Internal" components.<p>an anonymous user suggested:<br />I would like to be able to register "internal" components which only can be accessed from within the same assembly as the requested type.
It's quite easy to implement. Simply call Assembly.GetCallingAssembly() when a component flagged with "Internal" are requested.</p>anonymoustag:autofac.uservoice.com,2008-02-07:Event/11370922010-02-12T04:22:37-08:002010-02-12T04:22:37-08:00Allow Interface<T> to Class<T,S> mapping supplying S argument in Resolve methodanonymoustag:autofac.uservoice.com,2008-02-07:Event/10372972010-01-11T15:03:32-08:002010-01-11T15:03:32-08:00Add Support to create custom IScope<p>an anonymous user suggested:<br />Currently it has the IScope but internally it uses the enum which restricts to create custom scope such as PerWebRequest. The current recommended way to create a child container is very similar to Unity but not like other container.</p>anonymoustag:autofac.uservoice.com,2008-02-07:Event/10001502010-01-01T01:01:07-08:002010-01-01T01:01:07-08:00Support Prism from Microsoft Patterns & Practices [is now planned]<p>Prism is a composite application framework created by Microsoft P&P.
There is a sample integration here: http://autofac.googlegroups.com/web/prizm.zip_.
Please add your vote if you'd like to see this added to Autofac Contrib.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/10001492010-01-01T01:01:07-08:002010-01-01T01:01:07-08:00Support Prism from Microsoft Patterns & Practices [updated]<p>Prism is a composite application framework created by Microsoft P&P.
There is a sample integration here: http://autofac.googlegroups.com/web/prizm.zip_.
Please add your vote if you'd like to see this added to Autofac Contrib.</p><p>nicholas.blumhardt (admin) responded:<br /><div class="typeset"><p>This is the top-voted item and so it is moving to the Autofac issue tracker as a planned item within the 2.1 milestone.</p>
<p>See <a href="http://code.google.com/p/autofac/issues/detail?id=178" rel="nofollow" target="_blank">http://code.google.com/p/autofac/issues/detail?id=178</a>.</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/7947982009-10-27T15:40:52-07:002009-10-27T15:40:52-07:00Support IModule buildup using MEF<p>steve.hebert suggested:<br />Support Export(typeof(IModule)) in Builder implementation. Perhaps add the support of named IModule types through the use of an attribute to filter the modules at load time.</p>steve.heberttag:autofac.uservoice.com,2008-02-07:Event/6759232009-09-13T21:42:01-07:002009-09-13T21:42:01-07:00Extend XML Configuration [updated]<p>Most Autofac applications use code to register services, and where necessary register only Modules via XML.
Some users have expressed interest in adding more fine-grained component registration to the XML sytax:
Examples:
* Constructor selection policy
* Tags
* Factory Methods
* Open generic types
* Resolve named services as constructor parameters
</p><p>Rinat Abdullin said:<br /><div class="typeset"><p>Hm... may be Boo-based initialization would be more flexible?
<br />XML feels horrible for anything that usually requires dealing with types or with lambdas.</p></div></p>Rinat Abdullintag:autofac.uservoice.com,2008-02-07:Event/6733972009-09-12T01:12:58-07:002009-09-12T01:12:58-07:00Support for "dynamic" instances via DLR<p>CVertex suggested:<br />Maybe this is already supported, so maybe a walkthrough/wiki about how to inject dynamic components</p>CVertextag:autofac.uservoice.com,2008-02-07:Event/6733882009-09-12T00:55:34-07:002009-09-12T00:55:34-07:00ASP.NET MVC integration demo in trunk [updated]<p>CVertex said:<br /><div class="typeset"><p>Not sure who posted the original suggestion, but i'd like to see examples of Filter, ModelBinder injection in the demo - not just controller injection.</p></div></p>CVertextag:autofac.uservoice.com,2008-02-07:Event/6192132009-08-15T23:21:27-07:002009-08-15T23:21:27-07:00Extend XML Configuration [updated]<p>Most Autofac applications use code to register services, and where necessary register only Modules via XML.
Some users have expressed interest in adding more fine-grained component registration to the XML sytax:
Examples:
* Constructor selection policy
* Tags
* Factory Methods
* Open generic types
* Resolve named services as constructor parameters
</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>When voting for this item, please give an indication of which features are important to you :)</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/6184382009-08-15T08:39:43-07:002009-08-15T08:39:43-07:00ASP.NET MVC integration demo in trunk [updated]<p>nicholas.blumhardt (admin) responded:<br /><div class="typeset"><p>I might not understand your suggestion - there is already a basic MVC demo in trunk, see the Remember* projects in the main solution. Can you give some more details? Thanks!</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/6163182009-08-14T03:06:16-07:002009-08-14T03:06:16-07:00ASP.NET MVC integration demo in trunkAnonymoustag:autofac.uservoice.com,2008-02-07:Event/6003482009-08-06T21:53:57-07:002009-08-06T21:53:57-07:00Support Prism from Microsoft Patterns & Practices [updated]<p>Prism is a composite application framework created by Microsoft P&P.
There is a sample integration here: http://autofac.googlegroups.com/web/prizm.zip_.
Please add your vote if you'd like to see this added to Autofac Contrib.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>The sample from the above link is now in Subversion and briefly documented here: <a href="http://code.google.com/p/autofac/wiki/PrismIntegration?ts=1249620682&updated=PrismIntegration" rel="nofollow" target="_blank">http://code.google.com/p/autofac/wiki/PrismIntegration?ts=1249620682&updated=PrismIntegration</a>
</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5980052009-08-05T22:10:03-07:002009-08-05T22:10:03-07:00WinForms Walkthrough<p>nicholas.blumhardt suggested:<br />Create an end-to-end walkthrough showing how to set up Autofac with Windows Forms (WinForms). Include a sample application.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5980042009-08-05T22:09:24-07:002009-08-05T22:09:24-07:00ASP.NET MVC Walkthrough<p>nicholas.blumhardt suggested:<br />Create an end-to-end walkthrough showing how to set up Autofac with ASP.NET MVC. Include a sample application (can be based on the Remember example in the Autofac source tree.)</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5980012009-08-05T22:08:25-07:002009-08-05T22:08:25-07:00WPF Walkthrough<p>nicholas.blumhardt suggested:<br />Create an end-to-end walkthrough showing how to set up Autofac with Windows Presentation Foundation (WPF). Include a sample application.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5980002009-08-05T22:07:39-07:002009-08-05T22:07:39-07:00WebForms Walkthrough<p>nicholas.blumhardt suggested:<br />Create an end-to-end walkthrough showing how to set up Autofac with ASP.NET WebForms. Include a sample application.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5979972009-08-05T22:05:54-07:002009-08-05T22:05:54-07:00Restructuring of documentation and more documentation through examples [updated]<p>The documentation is good, although I still find I run into problems.
a) I can't find what I'm looking for,
b) I find what I'm looking for but the examples aren't clear enough to understand.
Better use cases, or examples of what people are more likely to do. And also structured documentation rather than the flat wiki that currently exists.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Would it be sufficient to make the contents page at <a href="http://code.google.com/p/autofac/wiki/Contents" rel="nofollow" target="_blank">http://code.google.com/p/autofac/wiki/Contents</a> more noticeable?</p>
<p>I'm raising new suggestions for end-to-end walkthroughs under each of the major .NET application models.</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5979062009-08-05T20:48:56-07:002009-08-05T20:48:56-07:00Support Enterprise Library (Entlib) 5<p>nicholas.blumhardt suggested:<br />Entlib 5 can be configured to use a third-party IoC container (other than Unity.)
Please add your vote if you'd like to see an adapter added to Autofac Contrib.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5979012009-08-05T20:44:29-07:002009-08-05T20:44:29-07:00Support Prism from Microsoft Patterns & Practices<p>nicholas.blumhardt suggested:<br />Prism is a composite application framework created by Microsoft P&P.
There is a sample integration here: http://autofac.googlegroups.com/web/prizm.zip_.
Please add your vote if you'd like to see this added to Autofac Contrib.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928732009-08-03T19:44:15-07:002009-08-03T19:44:15-07:00Support Compact Framework (.NET CF)<p>nicholas.blumhardt suggested:<br />Add a build configuration for .NET CF.</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928592009-08-03T19:36:15-07:002009-08-03T19:36:15-07:00Extend XML Configuration<p>nicholas.blumhardt suggested:<br />Most Autofac applications use code to register services, and where necessary register only Modules via XML.
Some users have expressed interest in adding more fine-grained component registration to the XML sytax:
Examples:
* Constructor selection policy
* Tags
* Factory Methods
* Open generic types
* Resolve named services as constructor parameters
</p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928272009-08-03T19:19:19-07:002009-08-03T19:19:19-07:00Registration conventions [updated]<p>Not really sure how to put this in words or if there's a real use case.
But was thinking of conventions that could be defined, and Autofac regsiters everything matching that convention. Sort of like FluentNHibernate's AutoMapping.
So for example, anything that implements a single interface, register it as that interface.
Or, anything such as Converter<UserDto, User> where there are two types, register it using the former type, ie IConverter<UserDto>
This would make registration simpler, and also you could unit test your convention checking that certain types have been registered.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Sounds good. Any suggestions for how this API would look?</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928252009-08-03T19:17:34-07:002009-08-03T19:17:34-07:00Restructuring of documentation and more documentation through examples [updated]<p>The documentation is good, although I still find I run into problems.
a) I can't find what I'm looking for,
b) I find what I'm looking for but the examples aren't clear enough to understand.
Better use cases, or examples of what people are more likely to do. And also structured documentation rather than the flat wiki that currently exists.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>Hierarchical documentation sounds good - would a single "contents" page do the trick?</p>
<p>I like the idea of use-case based examples, perhaps we start a new suggestion (in UserVoice) for each specific use case, so that people can vote on the ones they'd like to read?</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928242009-08-03T19:15:34-07:002009-08-03T19:15:34-07:00Improved registration of types as their interfaces [updated]<p>I typically use a fair amount of interfaces to make testing/stubbing easier.
One slight pain I have with Autofac is registering a type .As() an interface it implements. Not a huge pain, but it would be nice to be able to write it much more cleanly.
At current I use reflection to do this. It would be nice instead if RegisterTypesFromAssembly() or RegisterTypesMatching() could be extended to do this. Something like:
RegisterTypesAssignableFrom(ICommand).AsInterface()
where AsInterface works out the interface the type implements directly. Bit messy but you get the idea.</p><p>nicholas.blumhardt said:<br /><div class="typeset"><p>I've thought about this quite often - the tricky part is that RegisterTypes...() and friends work lazily, while the As() part would force them to be eager.</p>
<p>Still, if there are more use cases that require this it could be the start of a cleaner batch registration interface.</p></div></p>nicholas.blumhardttag:autofac.uservoice.com,2008-02-07:Event/5928222009-08-03T19:12:07-07:002009-08-03T19:12:07-07:00Please come forth and suggest, folks! [is now spam]<p>Autofac is waiting for your ideas :)</p>Anonymoustag:autofac.uservoice.com,2008-02-07:Event/5915622009-08-03T07:02:28-07:002009-08-03T07:02:28-07:00Registration conventions [updated]<p>Not really sure how to put this in words or if there's a real use case.
But was thinking of conventions that could be defined, and Autofac regsiters everything matching that convention. Sort of like FluentNHibernate's AutoMapping.
So for example, anything that implements a single interface, register it as that interface.
Or, anything such as Converter<UserDto, User> where there are two types, register it using the former type, ie IConverter<UserDto>
This would make registration simpler, and also you could unit test your convention checking that certain types have been registered.</p><p>Robert Beal said:<br /><div class="typeset"><p>Or conventions in the sense, if you have class Service, Autofac will look for IService, ServiceInterface, etc... common combinations when registering the type.</p></div></p>Robert Beal