tag:autofac.uservoice.com,2008-02-07:/activity Autofac on UserVoice 2012-01-16T15:53:32-08:00 tag:autofac.uservoice.com,2008-02-07:Event/10567400 2012-01-16T15:53:32-08:00 2012-01-16T15:53:32-08:00 WPF 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> mabster tag:autofac.uservoice.com,2008-02-07:Event/10561381 2012-01-15T20:24:39-08:00 2012-01-15T20:24:39-08:00 add 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&lt;TKey, TValue&gt;. It'd be nice if IIndex had a HasKey(TKey key) method, returning bool, to simplify this test.</p> mabster tag:autofac.uservoice.com,2008-02-07:Event/9995419 2011-10-11T14:05:46-07:00 2011-10-11T14:05:46-07:00 Support 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> xepaul tag:autofac.uservoice.com,2008-02-07:Event/9384633 2011-08-09T06:20:58-07:00 2011-08-09T06:20:58-07:00 Support 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 Konfetti tag:autofac.uservoice.com,2008-02-07:Event/8933631 2011-07-12T09:02:48-07:00 2011-07-12T09:02:48-07:00 Extend 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 Pluskiewicz tag:autofac.uservoice.com,2008-02-07:Event/4772979 2011-01-09T00:20:32-08:00 2011-01-09T00:20:32-08:00 ASP.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 Ma tag:autofac.uservoice.com,2008-02-07:Event/4772953 2011-01-09T00:18:50-08:00 2011-01-09T00:18:50-08:00 Add a NuGet package for MVC3 integration Andrew Ma tag:autofac.uservoice.com,2008-02-07:Event/4537587 2010-12-23T19:48:52-08:00 2010-12-23T19:48:52-08:00 Utilize 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/4537585 2010-12-23T19:48:52-08:00 2010-12-23T19:48:52-08:00 Utilize 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/4514815 2010-12-22T10:31:14-08:00 2010-12-22T10:31:14-08:00 Utilize 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 Meyer tag:autofac.uservoice.com,2008-02-07:Event/4462739 2010-12-19T14:13:11-08:00 2010-12-19T14:13:11-08:00 Utilize 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2939049 2010-09-16T14:18:02-07:00 2010-09-16T14:18:02-07:00 Move types like Meta&lt;&gt;, Owned&lt;&gt; 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 Hencke tag:autofac.uservoice.com,2008-02-07:Event/2664583 2010-08-18T15:49:52-07:00 2010-08-18T15:49:52-07:00 Add 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2664563 2010-08-18T15:46:28-07:00 2010-08-18T15:46:28-07:00 Move types like Meta&lt;&gt;, Owned&lt;&gt; 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2664547 2010-08-18T15:44:53-07:00 2010-08-18T15:44:53-07:00 Improved 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&lt;ICommand&gt;() <br /> .AsImplementedInterfaces();</p> <p>How does this go towards your original suggestion?</p> <p>Cheers! <br />Nick</p></div></p> nicholas.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2659855 2010-08-18T06:59:36-07:00 2010-08-18T06:59:36-07:00 Move types like Meta&lt;&gt;, Owned&lt;&gt; 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 Hencke tag:autofac.uservoice.com,2008-02-07:Event/2370305 2010-07-12T21:11:42-07:00 2010-07-12T21:11:42-07:00 Support C# 4.0 optional parameters for constructor resolution [is now completed] nicholas.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2370303 2010-07-12T21:11:42-07:00 2010-07-12T21:11:42-07:00 Support 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2370295 2010-07-12T21:09:45-07:00 2010-07-12T21:09:45-07:00 Registration 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&lt;UserDto, User&gt; where there are two types, register it using the former type, ie IConverter&lt;UserDto&gt; This would make registration simpler, and also you could unit test your convention checking that certain types have been registered.</p> nicholas.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/2370293 2010-07-12T21:09:45-07:00 2010-07-12T21:09:45-07:00 Registration 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&lt;UserDto, User&gt; where there are two types, register it using the former type, ie IConverter&lt;UserDto&gt; 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/1678811 2010-04-02T19:31:44-07:00 2010-04-02T19:31:44-07:00 Please come forth and suggest, folks! [is now none] <p>Autofac is waiting for your ideas :)</p> Anonymous tag:autofac.uservoice.com,2008-02-07:Event/1161786 2010-02-20T15:39:09-08:00 2010-02-20T15:39:09-08:00 Resolve open generic interfaces by constraint [updated] <p>Support resolving open generics by the most specific constraint. For example: class MyService&lt;T&gt; { } class MyFooService&lt;T&gt; : MyService&lt;T&gt; where T : IFoo { } b.Register&lt;MyService&lt;&gt;&gt;(); b.Register&lt;MyFooService&lt;&gt;&gt;().As&lt;MyService&lt;&gt;&gt;() c.Resolve&lt;MyService&lt;object&gt;&gt;() // gets a MyService c.Resolve&lt;MyService&lt;FooImplementor&gt;&gt;() // 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/1154240 2010-02-18T07:52:58-08:00 2010-02-18T07:52:58-08:00 Resolve open generic interfaces by constraint <p>Ilia Jerebtsov suggested:<br />Support resolving open generics by the most specific constraint. For example: class MyService&lt;T&gt; { } class MyFooService&lt;T&gt; : MyService&lt;T&gt; where T : IFoo { } b.Register&lt;MyService&lt;&gt;&gt;(); b.Register&lt;MyFooService&lt;&gt;&gt;().As&lt;MyService&lt;&gt;&gt;() c.Resolve&lt;MyService&lt;object&gt;&gt;() // gets a MyService c.Resolve&lt;MyService&lt;FooImplementor&gt;&gt;() // gets a MyFooService</p> Ilia Jerebtsov tag:autofac.uservoice.com,2008-02-07:Event/1137702 2010-02-12T08:43:04-08:00 2010-02-12T08:43:04-08:00 &quot;Internal&quot; components. <p>an anonymous user suggested:<br />I would like to be able to register &quot;internal&quot; 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 &quot;Internal&quot; are requested.</p> anonymous tag:autofac.uservoice.com,2008-02-07:Event/1137092 2010-02-12T04:22:37-08:00 2010-02-12T04:22:37-08:00 Allow Interface&lt;T&gt; to Class&lt;T,S&gt; mapping supplying S argument in Resolve method anonymous tag:autofac.uservoice.com,2008-02-07:Event/1037297 2010-01-11T15:03:32-08:00 2010-01-11T15:03:32-08:00 Add 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> anonymous tag:autofac.uservoice.com,2008-02-07:Event/1000150 2010-01-01T01:01:07-08:00 2010-01-01T01:01:07-08:00 Support Prism from Microsoft Patterns &amp; Practices [is now planned] <p>Prism is a composite application framework created by Microsoft P&amp;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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/1000149 2010-01-01T01:01:07-08:00 2010-01-01T01:01:07-08:00 Support Prism from Microsoft Patterns &amp; Practices [updated] <p>Prism is a composite application framework created by Microsoft P&amp;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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/794798 2009-10-27T15:40:52-07:00 2009-10-27T15:40:52-07:00 Support 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.hebert tag:autofac.uservoice.com,2008-02-07:Event/675923 2009-09-13T21:42:01-07:00 2009-09-13T21:42:01-07:00 Extend 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 Abdullin tag:autofac.uservoice.com,2008-02-07:Event/673397 2009-09-12T01:12:58-07:00 2009-09-12T01:12:58-07:00 Support for &quot;dynamic&quot; instances via DLR <p>CVertex suggested:<br />Maybe this is already supported, so maybe a walkthrough/wiki about how to inject dynamic components</p> CVertex tag:autofac.uservoice.com,2008-02-07:Event/673388 2009-09-12T00:55:34-07:00 2009-09-12T00:55:34-07:00 ASP.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> CVertex tag:autofac.uservoice.com,2008-02-07:Event/619213 2009-08-15T23:21:27-07:00 2009-08-15T23:21:27-07:00 Extend 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/618438 2009-08-15T08:39:43-07:00 2009-08-15T08:39:43-07:00 ASP.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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/616318 2009-08-14T03:06:16-07:00 2009-08-14T03:06:16-07:00 ASP.NET MVC integration demo in trunk Anonymous tag:autofac.uservoice.com,2008-02-07:Event/600348 2009-08-06T21:53:57-07:00 2009-08-06T21:53:57-07:00 Support Prism from Microsoft Patterns &amp; Practices [updated] <p>Prism is a composite application framework created by Microsoft P&amp;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&amp;updated=PrismIntegration" rel="nofollow" target="_blank">http://code.google.com/p/autofac/wiki/PrismIntegration?ts=1249620682&amp;updated=PrismIntegration</a> </p></div></p> nicholas.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/598005 2009-08-05T22:10:03-07:00 2009-08-05T22:10:03-07:00 WinForms 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/598004 2009-08-05T22:09:24-07:00 2009-08-05T22:09:24-07:00 ASP.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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/598001 2009-08-05T22:08:25-07:00 2009-08-05T22:08:25-07:00 WPF 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/598000 2009-08-05T22:07:39-07:00 2009-08-05T22:07:39-07:00 WebForms 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/597997 2009-08-05T22:05:54-07:00 2009-08-05T22:05:54-07:00 Restructuring 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/597906 2009-08-05T20:48:56-07:00 2009-08-05T20:48:56-07:00 Support 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/597901 2009-08-05T20:44:29-07:00 2009-08-05T20:44:29-07:00 Support Prism from Microsoft Patterns &amp; Practices <p>nicholas.blumhardt suggested:<br />Prism is a composite application framework created by Microsoft P&amp;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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592873 2009-08-03T19:44:15-07:00 2009-08-03T19:44:15-07:00 Support Compact Framework (.NET CF) <p>nicholas.blumhardt suggested:<br />Add a build configuration for .NET CF.</p> nicholas.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592859 2009-08-03T19:36:15-07:00 2009-08-03T19:36:15-07:00 Extend 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592827 2009-08-03T19:19:19-07:00 2009-08-03T19:19:19-07:00 Registration 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&lt;UserDto, User&gt; where there are two types, register it using the former type, ie IConverter&lt;UserDto&gt; 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592825 2009-08-03T19:17:34-07:00 2009-08-03T19:17:34-07:00 Restructuring 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 &quot;contents&quot; 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592824 2009-08-03T19:15:34-07:00 2009-08-03T19:15:34-07:00 Improved 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.blumhardt tag:autofac.uservoice.com,2008-02-07:Event/592822 2009-08-03T19:12:07-07:00 2009-08-03T19:12:07-07:00 Please come forth and suggest, folks! [is now spam] <p>Autofac is waiting for your ideas :)</p> Anonymous tag:autofac.uservoice.com,2008-02-07:Event/591562 2009-08-03T07:02:28-07:00 2009-08-03T07:02:28-07:00 Registration 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&lt;UserDto, User&gt; where there are two types, register it using the former type, ie IConverter&lt;UserDto&gt; 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