Page 1 of 1

EF Core Migration Scripts is incompleted

Posted: Thu 10 May 2018 07:23
by Zerda
I have built an .Net Core 2.0 console app, with EF Core 2.0.3,dotConnect for Oracle 9.5.502.

Code: Select all

namespace OraclePoc
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }

    class Product
    {
        public int Id { get; set; }
    }

    class MyDbContext : DbContext
    {
        public DbSet<Product> Products { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseOracle(@"REDACTED");
        }
    }
}
When I issue an migration with `Add-Migration InitialCreate` in NuGet Console, It created three files.
- 20180510071055_InitialCreate.cs
- 20180510071055_InitialCreate.Designer.cs
- MyDbContextModelSnapshot.cs

In file 20180510071055_InitialCreate.Designer.cs and file MyDbContextModelSnapshot.cs, the first using is not complete.

Code: Select all

// <auto-generated />
using ;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using OraclePoc;
using System;
This bug came from dotConnect for Oracle 9.5.454. Thanks.

Re: EF Core Migration Scripts is incompleted

Posted: Tue 15 May 2018 06:29
by Shalex
The bug is NOT specific to our provider.

EF Core Team is working on this issue: https://github.com/aspnet/EntityFramewo ... ssues/2467.

Re: EF Core Migration Scripts is incompleted

Posted: Fri 18 May 2018 02:40
by Zerda
Maybe this scenario is not covered in #2467.

MyDbContext has namespace OraclePoc, and it's working correctly in SqlServer provider.

I have compared same migration class between dotConnect for Oracle 9.5.429 (working) and 9.5.502 (bugged).

The missing using is

Code: Select all

using Devart.Data.Oracle.Entity;

Re: EF Core Migration Scripts is incompleted

Posted: Tue 22 May 2018 11:09
by Shalex
Thank you for the additional information.

We have reproduced the issue and are investigating it.

Re: EF Core Migration Scripts is incompleted

Posted: Fri 25 May 2018 14:45
by Shalex
The bug with missing Devart.Data.Oracle.Entity namespace in *.Designer.cs generated by EF Core 2 Code-First Migrations via Devart NuGet package is fixed: viewtopic.php?f=1&t=37215.