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" <[EMAIL PROTECTED]> 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
>
> On Fri, Oct 24, 2008 at 8:03 PM, jsimons <[EMAIL PROTECTED]> wrote:
> > The DictHelper class at the moment is casting all values added to its
> > internal dictionary to strings.
> > The reason for this is so that we can use it in situations like:
> > $Url.For($Dict.CreateN("action", "myaction").N("controller",
> > "mycontroller").N("querystring", $Dict.CreateN("t", "param1").N("s",
> > "param2")))
> > or
> > $Url.For($Dict.CreateN("action", "myaction").N("controller",
> > "mycontroller").N("params", $Dict.CreateN("t", "param1").N("s",
> > "param2")))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---