EF Core Migration Scripts is incompleted

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Zerda
Posts: 10
Joined: Wed 22 Jan 2014 00:16

EF Core Migration Scripts is incompleted

Post by Zerda » Thu 10 May 2018 07:23

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.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Migration Scripts is incompleted

Post by Shalex » Tue 15 May 2018 06:29

The bug is NOT specific to our provider.

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

Zerda
Posts: 10
Joined: Wed 22 Jan 2014 00:16

Re: EF Core Migration Scripts is incompleted

Post by Zerda » Fri 18 May 2018 02:40

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;

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Migration Scripts is incompleted

Post by Shalex » Tue 22 May 2018 11:09

Thank you for the additional information.

We have reproduced the issue and are investigating it.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Migration Scripts is incompleted

Post by Shalex » Fri 25 May 2018 14:45

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.

Post Reply