When I try to pass two parameters that are of the same type like so:
public IPercentage CreatePercentage(int part, int total)
{
return _container.Resolve<T>(new Arguments(part, total));
}
To a constructor like so:
public Percentage(int part, int total)
{
// ...
}
Then I get a System.ArgumentException: An item with the same key has already been added.
How can I pass arguments of same type?
- The key thing is I would like to avoid using literal string names of the parameters to identify which arguments goes where
- And instead use the order of the arguments
- and just the fact that it is the only constructor that fits, although I'm guessing the dictionary implementation of Windsor does not allow that.