¿Qué podría ser un LINQ equivalente al siguiente código?Cómo concatenar dos colecciones por índice en LINQ
string[] values = { "1", "hello", "true" };
Type[] types = { typeof(int), typeof(string), typeof(bool) };
object[] objects = new object[values.Length];
for (int i = 0; i < values.Length; i++)
{
objects[i] = Convert.ChangeType(values[i], types[i]);
}
O simplemente: 'objetos var = values.zip (tipos, (v, t) => Convert.ChangeType (v, t));' – Ken
Ken, tienes razón. Actualizaré mi publicación. Gracias. –
Actualizado. Gracias por el consejo. –