Last active
August 29, 2015 14:27
-
-
Save straubt1/9cf1bdcf9c4b5db8273f to your computer and use it in GitHub Desktop.
AOPinIoC_Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static WindsorContainer _kernel; | |
static void Main(string[] args) | |
{ | |
_kernel = new WindsorContainer(); | |
_kernel.Install(FromAssembly.This()); | |
var pData = _kernel.Resolve<IProjectData>(); | |
try | |
{ | |
Run(pData); | |
} | |
catch (Exception exception) | |
{ | |
System.Console.WriteLine("Program threw an exception: {0}", exception.Message); | |
} | |
System.Console.Read(); | |
} | |
static void Run(IProjectData data) | |
{ | |
var d = data.GetAllItems(); | |
System.Console.WriteLine("Get some Project Data: {0} items", d.Count); | |
foreach (var item in d) | |
{ | |
System.Console.WriteLine("\t({0}) Name:{1}, Type:{2}", item.Id, item.Name, item.ItemType); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment