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

169
Views
Differentiate between generic T and IEnumerable<T>

So the problem is following: I'm trying to somehow differentiate between two same methods while calling them. Idea is if I pass IEnumerable<> it should call respective method taking IEnumerable rather than just T. But in reality every time first method taken T get called. Is there any workaround for it?

    public void TestMethod<T>(T value)
    {

    }

    public void TestMethod<T>(IEnumerable<T> values)
    {

    }

Or if it's impossible maybe somehow to cast T from first method to IEnumerable, I've tried doing it with expressions but no luck still..

over 4 years ago · Santiago Trujillo
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!