question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EF Core 3.1 Beta 2 - Difference between two Date columns

See original GitHub issue

With Oracle EF Core 3.1 Beta 2, when I try to do a difference between two Date columns :

var row = (from r in dbContext.Entities select new { ElapsedTime = r.EndDate - r.StartDate }).FirstOrDefault();

I get a System.InvalidCastException: 'Unable to cast object of type 'System.Decimal' to type 'System.TimeSpan'.'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexkehcommented, Jul 21, 2020

I believe EF.Functions.Like is available, but we haven’t implemented anything additional.

1reaction
alexkehcommented, Jul 21, 2020

This appears related to bug 31423881 that a customer reported on the OTN ODP.NET forum. This bug has been fixed, but missed making it into beta 2. The bug fix will be in the production release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EF Core Include Between DateTimes
NET CORE with Entity Framework Core and I am trying to filter out result within a specific DATETIME frame. This is my DBContext...
Read more >
Breaking changes included in EF Core 3.x
Complete list of breaking changes introduced in Entity Framework Core 3.x.
Read more >
Calculate the difference between two dates
Use the DATEDIF function when you want to calculate the difference between two dates. First put a start date in a cell, and...
Read more >
Entity Framework
Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET. It was originally shipped as an integral part of ....
Read more >
Oracle EF Core 3.1 Beta 2 Now Available | by Alex Keh
Beta 2 of the Oracle Entity Framework Core (EF Core) 3.19.0 is now available as a NuGet Gallery download. Be sure to check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found