Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
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

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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

public JsonResult MyMethod(string @ref)

You can read more here

over 4 years ago · Santiago Trujillo Report

0

You can also use the Name property of FromUriAttribute:

public JsonResult MyMethod([FromUri(Name = "ref")] string reference)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!