Problem with mapping nullable column (Oracle Provider)

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
dzambo2302
Posts: 2
Joined: Fri 07 Sep 2018 08:14

Problem with mapping nullable column (Oracle Provider)

Post by dzambo2302 » Fri 07 Sep 2018 08:36

I'm starting with Database First mapping (Devart Oracle Provider 9.6.584.0 - licensed) and I'm facing to interesting error. Edml model is generated correctly, properties which should be nullable are set to nullable on Classes part and also on Store part, but Desinger code contains those properties as not null types and that causes runtime errors when I'm trying to execute a query.

What am I doing wrong?

Oracle table example:

Code: Select all

create table ORDERS
(
  ID                        NUMBER not null,
  ORG_ID       NUMBER(10) not null,
  ORDER_NUMBER              NUMBER(10) not null,
  PARTNERS_ID            NUMBER(10),
  TIME_PASS_PLANNED         INTERVAL DAY(2) TO SECOND(0),
  ROUTES_ID          NUMBER(10)
)
Part of Desinger code as an example:

Code: Select all

	[EdmScalarPropertyAttribute()]
        [DataMemberAttribute()]
        public virtual global::System.Decimal PARTNERS_ID
        {
            get
            {
                global::System.Decimal value = _PARTNERS_ID;
                OnGetPARTNERS_ID(ref value);
                return value;
            }
            set
            {
                if (_PARTNERS_ID != value)
                {
                  OnPARTNERS_IDChanging(ref value);
                  ReportPropertyChanging("PARTNERS_ID");
                  _PARTNERS_ID = StructuralObject.SetValidValue(value);
                  ReportPropertyChanged("PARTNERS_ID");
                  OnPARTNERS_IDChanged();
              }
            }
        }
        private global::System.Decimal _PARTNERS_ID;
        partial void OnGetPARTNERS_ID(ref global::System.Decimal value);
        partial void OnPARTNERS_IDChanging(ref global::System.Decimal value);
        partial void OnPARTNERS_IDChanged();
        
        [EdmScalarPropertyAttribute()]
        [DataMemberAttribute()]
        public virtual global::System.TimeSpan TIME_PASS_PLANNED
        {
            get
            {
                global::System.TimeSpan value = _TIME_PASS_PLANNED;
                OnGetTIME_PASS_PLANNED(ref value);
                return value;
            }
            set
            {
                if (_TIME_PASS_PLANNED != value)
                {
                  OnTIME_PASS_PLANNEDChanging(ref value);
                  ReportPropertyChanging("TIME_PASS_PLANNED");
                  _TIME_PASS_PLANNED = StructuralObject.SetValidValue(value);
                  ReportPropertyChanged("TIME_PASS_PLANNED");
                  OnTIME_PASS_PLANNEDChanged();
              }
            }
        }
        private global::System.TimeSpan _TIME_PASS_PLANNED;
        partial void OnGetTIME_PASS_PLANNED(ref global::System.TimeSpan value);
        partial void OnTIME_PASS_PLANNEDChanging(ref global::System.TimeSpan value);
        partial void OnTIME_PASS_PLANNEDChanged();

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with mapping nullable column (Oracle Provider)

Post by Pinturiccio » Mon 10 Sep 2018 14:16

This is a known issue. We have already fixed it.
The bug with code generation for nullable properties for EF1/EF4/EF5/EF6 is fixed

We will post here when the corresponding build of dotConnect for Oracle is available for download.

dzambo2302
Posts: 2
Joined: Fri 07 Sep 2018 08:14

Re: Problem with mapping nullable column (Oracle Provider)

Post by dzambo2302 » Mon 10 Sep 2018 15:01

Thank you for a quick response.
Is there any ETA on the new build?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with mapping nullable column (Oracle Provider)

Post by Pinturiccio » Wed 12 Sep 2018 13:56

We are planning to release a new public build of dotConnect for Oracle at the end of the next week. You can downgrade to a previous public build. Or if you are interested, we can send you an internal build with the fix. Please send us the license number or email, for which dotConnect for Oracle were purchased.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with mapping nullable column (Oracle Provider)

Post by Pinturiccio » Thu 20 Sep 2018 13:18

New build of Entity Developer 6.3.582 is available for download!
It can be downloaded from https://www.devart.com/entitydeveloper/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=37707

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with mapping nullable column (Oracle Provider)

Post by Pinturiccio » Thu 20 Sep 2018 13:21

New build of dotConnect for Oracle 9.6.597 is available for download.
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only).
We have also updated our NuGet package: https://www.nuget.org/packages/Devart.D ... le.EFCore/
For more information, please refer to viewtopic.php?t=37715

Post Reply