I'm new to Nancy,

I see I can work with the query string using Request.Query.Foo and check for the existence of the value via Request.Query.Foo.HasValue. If I try to read Foo and it does not exist, does Nancy return null or does it throw?

有帮助吗?

解决方案

Foo will be of type DynamicDictionaryValue, so you will actually need to access the Value property to use it, just as you would a Nullable type. It won't simply throw an error for referencing Request.Query.Foo unless you try to do something with the .Value and it is null.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top