query from transact sql to linq

1

I have a query in Transact SQL , and I need to modify it to LinQ for a migration of a program I'm doing, but I've had problems specifically with a function of SQL Server , the datediff , with which It has been difficult for me to do it in LinQ .

SELECT        AVG(Diario) AS Expr1
FROM            (SELECT        SUM(VolumenTanqueo) AS Diario
             FROM            EQ_Tanqueo
             GROUP BY FechaTanqueo
             HAVING         (DATEDIFF(dd, FechaTanqueo, GETDATE()) <= 100))
     AS derivedt
    
asked by camilo7 03.08.2016 в 21:14
source

1 answer

0

To implement the DateDiff in linq you must implement

SqlFunctions.DateDiff Method

this will convert the linq to sql

    
answered by 03.08.2016 / 22:21
source