views:

79

answers:

2

I would like to convert this fluent approach to xml:

container.Register(
    AllTypes.FromAssemblyNamed("Company.DataAccess")
        .BasedOn(typeof(IReadDao<>)).WithService.FromInterface(),
    AllTypes.FromAssemblyNamed("Framework.DataAccess.NHibernateProvider")
        .BasedOn(typeof(IReadDao<>)).WithService.Base());

Is there any way of doing this, maintaining the simplicity?

A: 

Currently there is no way to do batch registrations in XML. If you really want to express this in XML (I wonder why) you'll have to enumerate each component to be registered.

The closest thing was the batch registration facility, but it has been deprecated.

Mauricio Scheffer
You convinced me. I will try other approach. :)
Jonathas Costa
A: 

You may want to try Binsor, which is a Boo DSL for registering components, but I'm not entirely sure how up to date it is.

Be advised that what you're trying to do is not a recommended practice and brings more headaches than true value. Stick to code.

Krzysztof Koźmic

related questions