but if that is the reason why is the N and CreateN method signature:
(string key, object value) ?
at the moment a simple test like this breaks:
[Test]
public void MyBrokenTest()
{
IDictionary dict = DictHelper.CreateN("int", 1).N("bool", true);
Assert.AreEqual(1, dict["int"]);
Assert.AreEqual(true, bool);
}
As a consumer of this class I was expecting this test to pass.
I guess we could either:
1. change the methods signature to (string key, string value) -> this
is a breaking change
2. allow objects to be stored in the dictionary by removing the
ToString cast -> this would not break the interface
thoughts?
On Oct 25, 12:12 pm, "James Curran" <
james.cur...@gmail.com> wrote:
> Mainly because, originally, you created an entries with
> Create("action=myaction","controller=mycontroller");
>
> This led to people doing things like Create("ID="+id.ToString()); so
> I added the N() syntax to simplify things. But, since they were both
> strings before, so I kept them strings in the patch.
>
> Also, I believe the very original purpose was to create query strings,
> which were, by necessity, strings.
>
> --
> Truth,
> James
>