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

215
Views
How can you use optional parameters in C#?

We are creating a web API that is generated programmatically from a C# class. The class has a GetFooBar(int a, int b) method and the API has a GetFooBar method that takes query parameters like &a=foo &b=bar .

Classes must support optional parameters, which are not supported in the C# language. What is the best approach?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

optional parameters since C# 4.0 work like this:

 public void SomeMethod(int a, int b = 0) { //some code }

where int b = 0 is an optional parameter.

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!