Skip to content

Instantly share code, notes, and snippets.

@straubt1
Last active August 29, 2015 14:27
Show Gist options
  • Save straubt1/9cf1bdcf9c4b5db8273f to your computer and use it in GitHub Desktop.
Save straubt1/9cf1bdcf9c4b5db8273f to your computer and use it in GitHub Desktop.
AOPinIoC_Program
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