Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Consider making verbs in HttpMethods as const string rather than static readonly string #795

Closed
kchanlee opened this issue Mar 19, 2017 · 2 comments

Comments

@kchanlee
Copy link
Contributor

When I am trying to use AcceptVerbsAttribute, I don't want to write verbs literally (e.g. [AcceptVerbs("GET", "POST")]) so I try to reuse the verbs defined in HttpMethods (e.g. [AcceptVerbs(HttpMethods.Get, HttpMethods.Post)]). But this is not acceptable by compiler.

How about making verbs in HttpMethods as const string rather than static readonly string so that they can be more widely used?

@khellang
Copy link
Contributor

khellang commented Mar 20, 2017

This has been discussed before; #712 (comment), but I think @davidfowl felt strongly that they should be static readonly for some reason.

@kchanlee
Copy link
Contributor Author

@khellang Thanks for pointing it out. Let me close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants