//	Manual example
public class Samurai
{
    private readonly IWeapon _weapon;
 
    public Samurai(IWeapon weapon)
    {
        _weapon = weapon;
    }
 
    public void Attack(string target)
    {
        _weapon.Hit(target);
    }
}
 
public class Program
{
    static void Main() {
        Samurai samurai = new Samurai(new Sword());
        samurai.Attack("bad programmers");
        Console.ReadLine();
    }
}

//	Using Ninject
public interface IWarrior
{
    void Attack(string target);
}
 
public class Samurai : IWarrior
{
    private readonly IWeapon _weapon;
 
    public Samurai(IWeapon weapon)
    {
        _weapon = weapon;
    }
 
    public void Attack(string target)
    {
        _weapon.Hit(target);
    }
}
 
public class Program
{
    static void Main()
    {
        IKernel kernel = new StandardKernel();
 
        kernel.Bind<IWarrior>().To<Samurai>();
        kernel.Bind<IWeapon>().To<Sword>();
 
        IWarrior samurai = kernel.Get<IWarrior>();
 
        samurai.Attack("bad programmers");
 
        Console.ReadLine();
    }
}