dot connect EF and EntityFunctions

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 8
Joined: Sun 04 Dec 2011 00:10

dot connect EF and EntityFunctions

Post by vonbrana » Tue 03 Dec 2013 17:16

I am using dot connect for Oracle EF version, so the new EF 6 version.
From the documentation I think the following query should work:

DateTime? today = DateTime.Today;

using (STUDSYSEntities cntxt = new STUDSYSEntities(_connString))
var dois = (from d in cntxt.STUD_CPS_INTERVENTION_DETAIL

where d.END_DATE == null
&& EntityFunctions.DiffDays(d.BEGIN_DATE.Value, today) % 7 == 1
select d).ToList();

return dois;

but it throws an error:
LINQ to Entities does not recognize the method 'System.Nullable`1[System.Int32] DiffDays

What is the status of support with the EF 6 and EntityFunctions?

What I am trying to do is select records that have a begin date with a day of week the same as today. I know I could just get all the records from the database and then apply the criteria, but I would like if possible to send the day of week criteria to the database and only bring back the records I am interested in. Is this possible?

Devart Team
Posts: 7976
Joined: Thu 14 Aug 2008 12:44

Re: dot connect EF and EntityFunctions

Post by Shalex » Wed 04 Dec 2013 14:23

Please use System.Data.Entity.DbFunctions instead of System.Data.Objects.EntityFunctions.

The list of Entity Framework Canonical Functions which are supported in dotConnect for Oracle is available at ... tions.html.

Post Reply