Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

API with an parameter named with keyword word in c#

One of the API calling from outside company to our use the parameter name "ref". They asking us to create the web api which accept this parameter. We are writing in C# Web Api and "ref" is a keyword and wont able to do that. Any work around?

https://xxxxxxxxx/xxx/xxx/xxxxx/?ref=1234

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can accept ref as a parameter using@ symbol in front of your field:

public JsonResult MyMethod(string @ref)

You can read more here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading