Forum Stats

  • 3,722,467 Users
  • 2,244,317 Discussions
  • 7,849,855 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Difference between Dates / Entity Framework Core 3.1

1495799
1495799 Member Posts: 8
edited July 2020 in ODP.NET

Hello,

I have an exception when I try to get the difference between two dates (in Days) with the new Oracle.EntityFrameworkCore 3.19.0-beta1 NuGet package :

var row = (

        from r in dbContext.Entitites

        select new { (DateTime.Now - r.DateTimeColumn).Days }

    ).FirstOrDefault();

System.InvalidCastException: 'Specified cast is not valid.'

   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetDecimal(Int32 i)

   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetValue(Int32 i)

   at System.Data.Common.DbDataReader.GetFieldValue[T](Int32 ordinal)

42639653818723

Best Answer

Answers

Sign In or Register to comment.