I have a form:
public partial class mdiAuthenticationForm : Form
{
public Services.Authentication.IAuthentication Authenticator { get; set;
public Services.Authentication.IAuthorization Authorizor { get; set; }
and I want to inject concrete classes for the two attributes above.
I have a type for each of them, and am using the app.config for the configuration information. But, I don't want to create an interface for each page, just to inject, so, how can I inject into each page?
Basically, what to I put in the type attribute in the following type element, or, how can I do this?
<type type="" mapTo="mdiAuthenticationForm,project">
<typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
<property name="Authenticator" propertyType="Services.Authentication.IAuthentication,project">
<dependency name="mssqlauth" />
</property>
<property name="Authorizor" propertyType="Services.Authentication.IAuthorization,project">
<dependency name="mssqlautz" />
</property>
</typeConfig>
</type>
I am using the Unity Framework for this, btw.
Thank you.
Edit: I get the container and then I am trying to inject by using this:
Container.Configure<InjectedMembers>().ConfigureInjectionFor<mdiAuthenticationForm>();