/examples/ioc/DependencyInjectionSample/Program.cs
http://github.com/philiplaureano/LinFu · C# · 29 lines · 23 code · 4 blank · 2 comment · 0 complexity · 21a805d460781358bf71e6b72a77058b MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.Text;
- using CarLibrary;
- using LinFu.IoC;
- using LinFu.IoC.Configuration;
- using LinFu.IoC.Interfaces;
- namespace DependencyInjectionSample
- {
- class Program
- {
- static void Main(string[] args)
- {
- string directory = AppDomain.CurrentDomain.BaseDirectory;
- var container = new ServiceContainer();
- // Load CarLibrary.dll; If you need load
- // all the libaries in a directory, use "*.dll" instead
- container.LoadFrom(directory, "CarLibrary.dll");
- IVehicle vehicle = container.GetService<IVehicle>();
- Console.WriteLine("Press ENTER to continue...");
- Console.ReadLine();
- return;
- }
- }
- }