Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

LINQ Canonical Functions and Oracle Functions

1050157Jan 16 2014 — edited Jan 27 2014

Hello,

I am using EntityFramework (.NET 4) to access a Oracle Database (11g Express Edition Release 11.2.0.2.0 - 64bit Production).

For the most part it is working fine, but now I've stumble into a issue using LINQ Canonical Functions, that aparently are supported (see : Mapping LINQ Canonical Functions and Oracle Functions)

I am running the following expression :

     

var expirationDuration = 3000;

var record = Context.Table

                           .Where(x => x.Created.AddMilliseconds(expirationDuration) > DateTime.Now )

                           .FirstOrDefault();

And im getting a exception :

"LINQ to Entities does not recognize the method 'System.DateTime AddMilliseconds(Double)' method, and this method cannot be translated into a store expression."

Shouldn't AddMilliseconds be translated to (expression) + INTERVAL like the docs mentions?

Thanks for help

Regards,Nuno

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2014
Added on Jan 16 2014
1 comment
1,407 views