Example Microsoft Unity Block Configuration : Passing Value to Constructor

This is a sample of our configuration file that allows us to initialize value to our constructor.

























/// Our Constructor ////

[InjectionConstructor]
public MyClass(string myParam, string myParam2)
{
string p1 = myParam;
string p2 = myParam2;
}

Comments

Popular posts from this blog

OpenCover code coverage for .Net Core

Android Programmatically apply style to your view

Using Custom DLL with IronPython / Scripts