Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/07/2011, 04:40
jamacia1
 
Fecha de Ingreso: julio-2011
Mensajes: 1
Antigüedad: 12 años, 9 meses
Puntos: 0
Comparar listas en linq

Buenas
Estoy en un entorno asp.net, C# y tengo esta sentencia en Linq

var retorno = (from proyecto in contexto.Proyecto
where proyecto.BajaPro.Equals(false)
orderby proyecto.Paises
select proyecto);

var sortedRetorno = retorno.OrderBy(h => h.Fondos.NombreFondo)
.ThenByDescending(h => h.FechaAprobacionInstitucion)
.ThenBy(h => h.Paises.ToList(), new CompararListaPaises())
.ThenBy(h => h.Sectores.NombreSector);

El problema es cuando intento comparar la lista de países

.ThenBy(h => h.Paises.ToList(), new CompararListaPaises())

me da un error:
base {System.SystemException} = {"LINQ to Entities no reconoce el método 'System.Linq.IOrderedQueryable`1[Meh.Dgint.NET.Datos.Proyecto] ThenBy[Proyecto,List`1](System.Linq.IOrderedQueryable`1[Meh.Dgint.NET.Datos.Proyecto], System.Linq.Expressions.Expression`1[System.Func`2[Meh.Dgint.NET.D...

¿ Me puede ayudar alguien ?

Gracias