質問

I would like to get some experience using Unity 3 so I set up a console application and downloaded Unity from nuGet.

However I didn't find any examples on how I can start Unity? Do I need to add some code to my main method to make a Unity container or is it normal to put that code into another file and call that?

Note that I did find the "Unity hands-on labs" but these look far too complicated for a starter tutorial. I would really like to find some starter example coded in C# if anyone has any links bookmared that would be a great help.

役に立ちましたか?

解決

http://msdn.microsoft.com/en-us/library/dn178463(v=pandp.30).aspx

Basically, yes, you have to initialize Unity first. Just put this in the beginning of your Main method:

var container = new UnityContainer();
container.RegisterType<IYourType, YourType>();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top