Entity Framework AddDays

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 1
Joined: Mon 10 Nov 2014 03:32

Entity Framework AddDays

Post by sweil » Mon 10 Nov 2014 03:40


Can I use System.Data.Objects.EntityFunctions.AddDays or similar with the Devart PostgreSql data provider. I can't find the function in Devart.Data.PostgreSql.Entity.

I want to do something like this:

DbContext.Entity.Where(x => x.dateColumn.AddDays(x.lengthColumn))


DbContext.Entity.Where(x => PgSqlFunctions.AddDays(x.dateColumn ,x.lengthColumn))


Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Entity Framework AddDays

Post by MariiaI » Tue 11 Nov 2014 13:05

The DateTime.AddDays method is not supported in LINQ to Entities. You can use the EntityFunctions.AddDays method for this (System.Data.Entity.DbFunctions.AddDays for EF6).
Please refer to http://blog.devart.com/entity-framework ... tions.html, the "Date and Time Canonical Function" section (the EntityFunctions.AddDays is supported in dotConnect for PostgreSQL).

Some useful information is also available here:
http://stackoverflow.com/questions/4146 ... k-datetime

If you encounter any further issues with this, feel free to contact us.

Post Reply