Skip to content

Instantly share code, notes, and snippets.

@deapsquatter
Last active December 12, 2015 06:28
Show Gist options
  • Save deapsquatter/4729052 to your computer and use it in GitHub Desktop.
Save deapsquatter/4729052 to your computer and use it in GitHub Desktop.
IOC
interface IPullable
{
void Pull();
}
class Rope : IPullable
{
public void Pull()
{
Console.WriteLine("Pulled");
}
}
public static void Main (string[] args)
{
var ioc = IocContainer.Default;
Console.WriteLine("Register service = " + ioc.RegisterService(typeof(IPullable), () => new Rope()));
IPullable pullable = ioc.FindService<IPullable>();
pullable.Pull();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment