Well, I don't know if "strong naming" is the right term, but what I want to do is as follows.
Currently I use ConstructorArgument like e.g. this:
public class Ninja
{
private readonly IWeapon _weapon;
private readonly string _name;
public Ninja(string name, IWeapon weapon)
{
_weapon = weapon;
_name = name;
}
// ..more code..
}
public void SomeFunction()
{
var kernel = new StandardKernel();
kernel.Bind<IWeapon>().To<Sword>();
var ninja = kernel.Get<Ninja>(new ConstructorArgument("name", "Lee"));
}
Now, if I rename the parameter "name" (e.g. using ReSharper) the ConstructorArgument won't update, and I will get a runtime error when creating the Ninja. To fix this I need to manually find all places I specify this parameter through a ConstructorArgument and update it. No good, and I'm doomed to fail at some point even though I have good test coverage. Renaming should be a cheap operation.
Is there any way I can make a reference to the parameter instead - such that it is updated when I rename the parameter?