Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Works with Oracle.EntityFrameWorkCore beta 2 but broken with beta 3 - OracleRelationalCommand.Create

MikeR_WakeApr 15 2019 — edited May 6 2019

For a new application, we are using ASP.NET Core 2.2 Identity with the schema created in Oracle. We let the Oracle provider create a migration for the Identity tables and then generated a script from the migration. It has been working great with the Oracle EF Provider beta 2. However, with beta 3, there is an exception when the Identity framework tries to write a value to the LockoutEnd field. It fails with the error shown below. The datatype for the LockoutEnd field is TIMESTAMP (3) WITH TIME ZONE and the .NET datatype is DateTimeWithOffset. As mentioned, this works fine with the beta 2 release. Since this works in beta 2 I don't want to spend time looking for a work around in case this will work again in a future release.

Here is the mapping that is being used for the LockoutEnd field:

LockoutEnd (Nullable<DateTimeOffset>) 6 6 -1 -1 -1

        Annotations:

          Relational:TypeMapping: Oracle.EntityFrameworkCore.Storage.Internal.OracleDateTimeOffsetTypeMapping

Error during update:

OracleRelationalCommand.CreateCommand() :  System.ArgumentException: Value does not fall within the expected range.

   at Oracle.ManagedDataAccess.Client.OracleParameter.set_Value(Object value)

   at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping.CreateParameter(DbCommand command, String name, Object value, Nullable`1 nullable)

   at Microsoft.EntityFrameworkCore.Storage.Internal.TypeMappedRelationalParameter.AddDbParameter(DbCommand command, Object value)

   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBase.AddDbParameter(DbCommand command, IReadOnlyDictionary`2 parameterValues)

   at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.CreateCommand(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)

ERROR: An exception occurred in the database while saving changes for context type 'Wake.LandRecords.Ptms.Services.Identity.Infrastructure.Data.ApplicationDbContext'.

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.ArgumentException: Value does not fall within the expected range.

   at Oracle.ManagedDataAccess.Client.OracleParameter.set_Value(Object value)

This post has been answered by Alex Keh-Oracle on Apr 19 2019
Jump to Answer

Comments

Processing

Post Details

Added on Apr 15 2019
4 comments
884 views