Binsor & Auto Registration - Making it even simpler
Here is the syntax that I am getting at...
for type in AllTypesBased of IView("Rhino.Commons.Test"): component type for type in AllTypesWithAttribute of ControllerAttribute("Rhino.Commons.Test"): component type for type in AllTypes("Rhino.Commons.Test") \ .WhereNamespaceEq("Rhino.Commons.Test.Binsor"): component type for type in AllTypes("Rhino.Commons.NHibernate") \ .Where({ t as System.Type | t.Name.Contains("NHRepository") }): component "nh.repos", type.GetSeriveInterface(), type
And this seems to cover just about any scenario that I can think of. Combine that with Binsor's extend facility, and we are more or less done.
Comments
Great work Ayende!
It is similar to the new C# registration API in windsor:
Container.Register(AllTypes.Pick()
what if I want to register all types that are in a namespace which is not equal to "xyz" but that starts with "xyz"?
Gabriel,
Then you would use the where, not the WhereNamespaceEq()
Comment preview