2 Replies Latest reply on Sep 11, 2019 3:05 PM by Alex Keh - Product Manager-Oracle

    Oracle.EntitiyFramewokCore ENUM Conversion Problem

    4081139

      Hello,

       

      We are migrating our project to .net core and are using Oracle.EntitiyFramewokCore to connect to Oracle DB. But we have a problem with ENUM types. Please see below for more detail.

       

      ERROR: Microsoft.EntityFrameworkCore.DbUpdateException: 'An error occurred while updating the entries. See the inner exception for details.'

      Inner Exception: ArgumentException: Value does not fall within the expected range.

       

      public class SystemConfirmation

          {

              public long Id { get; set; }

              public long? ObjectId { get; set; }

              public SystemConfirmationStatus Status { get; set; }

              public ObjectType Type { get; set; }

              public byte[] Data { get; set; }

              public string DataType { get; set; }

              public long CompanyId { get; set; }

              public ConfirmationActionTypes ActionType { get; set; }

              public DateTime? InsertDatetime { get; set; }

              public DateTime? SysLastUpdate { get; set; }

              public int? SysVersion { get; set; }

          }

       

      Mapper:

       

      builder.ToTable("FIN_SYSTEM_CONFIRMATION", "EFINUSER");

                  builder.HasKey(x => x.Id);

                  builder.Property(x => x.Id).HasColumnName("ID").HasColumnType("NUMBER(12)");

                  builder.Property(x => x.ObjectId).HasColumnName("OBJECT_ID").HasColumnType("NUMBER(12)");

                  builder.Property(x => x.Status).HasColumnName("STATUS").HasColumnType("NUMBER(10)");

                  builder.Property(x => x.Type).HasColumnName("TYPE").HasColumnType("NUMBER(10)");

                  builder.Property(x => x.Data).HasColumnName("DATA").HasColumnType("BLOB");

                  builder.Property(x => x.DataType).HasColumnName("DATA_TYPE").HasColumnType("VARCHAR2").HasMaxLength(1000);

                  builder.Property(x => x.CompanyId).HasColumnName("COMPANY_ID").HasColumnType("NUMBER(12)").HasMaxLength(10);

                  builder.Property(x => x.ActionType).HasColumnName("ACTION_TYPE").HasColumnType("NUMBER(10)");

                  builder.Property(x => x.SysVersion).HasColumnName("SYS_VERSION").HasColumnType("NUMBER(10)");

                  builder.Property(x => x.SysLastUpdate).HasColumnName("SYS_LAST_UPDATE").HasColumnType("DATE");

                  builder.Property(x => x.InsertDatetime).HasColumnName("INSERT_DATETIME").HasColumnType("DATE");

       

      dbscreen.jpeg