The accepted answer is better in this case, but for reference you can use the EntityFunctions
class to perform operations on dates, among other things.
where (vid.CreatedDate >= EntityFunctions.AddDays(DateTime.Now, -maxAgeInDay))
More Related Contents:
- ASP.NET MVC 2.0 Implementation of searching in jqgrid
- What’s the difference(s) between .ToList(), .AsEnumerable(), AsQueryable()?
- The specified type member ‘Date’ is not supported in LINQ to Entities Exception
- Best way to check if object exists in Entity Framework? [closed]
- Entity Framework 4 / POCO – Where to start? [closed]
- Include Grandchildren in EF Query
- LINQ To Entities + Include + Anonymous type issue
- Why does EF5 code first use datetime2 when inserting a nullable datetime into the database?
- EF4 LINQ Ordering Parent and all child collections with Eager Loading (.Include())
- ‘Contains()’ workaround using Linq to Entities?
- EF Core Second level ThenInclude missworks
- The relationship could not be changed because one or more of the foreign-key properties is non-nullable
- Method cannot be translated into a store expression
- Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures? [closed]
- Disable lazy loading by default in Entity Framework 4
- Entity Framework 4.1 DbContext Override SaveChanges to Audit Property Change
- Entity Framework One-To-One Mapping Issues
- How can I delete 1,000 rows with EF6?
- How to exclude one table from automatic code first migrations in the Entity Framework?
- Entity Framework : How do you refresh the model when the db changes?
- Entity framework code first creates “discriminator” column
- EF Migrations: Rollback last applied migration?
- Using EF Core ThenInclude() on Junction tables
- How to update not every fields of an object using Entity Framework and EntityState.Modified
- What is the best practice in EF Core for using parallel async calls with an Injected DbContext?
- What goes into DbContextOptions when invoking a new DbContext?
- Entity Framework Validation confusion – maximum string length of ‘128’
- Number of members in conceptual type does not match with number of members on object side type
- Delete an object and all of its related entities in Entity Framework
- Entity Framework Core 2.0 – Run migrations step by step