I'm trying to pass a query to Linq, but it's not giving me the largest.
The query is:
SELECT MAX(CASE
WHEN RETIROFECHA IS NOT NULL AND RETIROCONFIRMADO = 'S' THEN RETIROFECHA
ELSE fechaActual END) FECHA
FROM VINCULACION_TPP
WHERE CODEMPLEADO = codEmpleado
I was doing a test and I got this, but it's still not giving me:
(from VI in _contexto.Vinculacion_MPP
where VI.CODEMPLEADO == codEmpleado
select new
{
fecha = (VI.RETIROFECHA != null & VI.RETIROCONFIRMADO == 'S') ? VI.RETIROFECHA : DateTime.Now
}).ToList();