Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda