views:

36

answers:

1

How can I specify that constructor with no parameter should be used while creating the object? I know how to do it for the parameterized one but cannot find any help for the parameter less constructor.

I know how to do this through code but need solution for doing it through configuration.

A: 

Could you just specify an empty constructor node in the config?

<types>
    <type type="MyProject.IRepository, MyProject, Version=1.0.0.0, Culture=neutral"
          mapTo="MyProject.DefaultRepository, MyProject, Version=1.0.0.0, Culture=neutral">
        <lifetime type="transient" />
        <typeConfig>
            <constructor>
            </constructor>
        </typeConfig>
    </type>
</types>
Igor Zevaka
Sure it works.I had had it already. It was some other piece of code messing up things.
danish