I have a class like:
public class CustomDatabase : Database
{
public CustomDatabase(string connString, ILogger logger)
{
}
}
for example I can use the following config section to config a type and constructor parameters
<type type="Database" mapTo="UnityExamples.Common.CustomDatabase, UnityExamples.Common">
<typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
<constructor>
<param name="connString" parameterType="System.String">
<value value="connection value..."/>
</param>
<param name="logger" parameterType="ILogger">
<dependency />
</param>
</constructor>
</typeConfig>
</type>
But how can I convert this section into pure C# code configuration?
Try the following