Can I use SqlFunctions.DatePart( ) with dotConnect for Oracle? (Linq to Entities)
If not, what is an alternative? OracleFunctions class?
If so, can you give an example please?
Thanks
SqlFunctions.DatePart with dotConnect
Re: SqlFunctions.DatePart with dotConnect
We will notify you when SqlFunctions.DatePart( ) is supported in dotConnect for Oracle.
As a workaround, please use the properties of the object:
As a workaround, please use the properties of the object:
Code: Select all
//var a1 = context.TSTABLEs.Where(b => SqlFunctions.DatePart("year", b.TSCOLUMN) == 2015).ToList();
var a2 = context.TSTABLEs.Where(b => b.TSCOLUMN.Value.Year == 2015).ToList();-
raffaelbechara
- Posts: 3
- Joined: Thu 09 Jul 2015 13:47
Re: SqlFunctions.DatePart with dotConnect
Thank you for replying. Therefore, I'm still with a problem:
I can't use object property "Offset" because calling it throws an "unsupported" exception:
It works fine with properties like Day, Year, and some others. Therefore, I really need the "Offset" property.
Any suggests please?
I can't use object property "Offset" because calling it throws an "unsupported" exception:
Code: Select all
b.Value.OffsetAny suggests please?
Re: SqlFunctions.DatePart with dotConnect
Try this way:
Code: Select all
var a3 = context.TSTABLEs.Where(b => System.Data.Entity.DbFunctions.GetTotalOffsetMinutes(b.TSCOLUMN) == 60).ToList();Re: SqlFunctions.DatePart with dotConnect
The SqlFunctions.DatePart method is supported in LINQ to Entities for the following modifiers: year, month, day, hour, minute, second, millisecond, tzoffset. The feature is available in the newest (9.1.55) build of dotConnect for Oracle.