I have the following code:
var vistaRecibos = (from r in ctx.RECIBOSPAGO_DETALLE_GENERAL
select new
{
r.idrecibopago,
});
var vistaAsientos = (from a in ctx.ASIENTO_CONTABLE
select new
{
a.idrecibopago,
});
vistaRecibos = vistaRecibos.Except(vistaAsientos);
Which gives me error:
Error 71 Type arguments to method 'System.Linq.Enumerable.Except(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)' cannot be inferred from usage. Try specifying the type arguments explicitly. C:\Users\German\Desktop\SAM Administrative\Leon\SAM1\Contabilidad\frmExportarAsientosContables.cs 461 36 sammayorazgo
I have used this comparison in other solutions and it does not give me an error (even the extra comma does not cause conflicts, and if I remove it, the problem continues).
Does anyone know how to fix it?
Simplify your lines like this
It is not necessary to add the word new {} , you would need it if you were mapping to another data type.