Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda