FHIR Chat · Case Sensitive Parameters in .net · dotnet

Stream: dotnet

Topic: Case Sensitive Parameters in .net


view this post on Zulip Kevin Mayfield (Sep 10 2019 at 11:07):

On asp.net core it doesn't support case sensitivity by default. We are searching for ways to get around this but anyone have any quick tips (we're not using vonk as the API we are using is non standard)

view this post on Zulip Gino Canessa (Sep 11 2019 at 16:07):

Hi Kevin, I'm not quite sure what you're asking about here.
If you are in a controller and want to get access to the original query string for custom processing, you can use HttpContext.Request.QueryString or HttpContext.Request.Query (assuming they haven't been mangled there). Is that what you are looking for?

view this post on Zulip Kevin Mayfield (Sep 12 2019 at 06:07):

I believe it was issues with [FromQuery] attribute. Thanks - I think we've done that (I'm not a c# dev - java)

view this post on Zulip Gino Canessa (Sep 12 2019 at 14:56):

Welcome to the dark side, we have cookies. If the above doesn't meet your needs, there is a lot more flexibility if you go into middleware (custom code to do the routing). A good overview is in the routing docs.

view this post on Zulip Gino Canessa (Sep 12 2019 at 15:13):

Posted slightly too soon. Even simpler (than the middleware option) is to add a regex route constraint to your routing, which can validate the case of the literal (e.g., controller/{action:regex(^CaseSensitiveActionOnly$)}).


Last updated: Apr 12 2022 at 19:14 UTC