efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Runnning ef migrations may generate a code that doesn't compile

Open dealdiane opened this issue 11 years ago • 1 comments

Suppose in your project, you have a file called SomeFile.cs with the following contents in it:

using System;
using Microsoft.Data.Entity;

public class SampleDb : DbContext
{
    public DbSet<Pet> Pets { get; set; }
}

Notice the lack of namespace in the code above.

Running ef migrations will generate the following code:

using System;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using Microsoft.Data.Entity.Migrations;
using ;

namespace Beta8Sample.Migrations
{
    [DbContext(typeof(SampleDb))]
    [Migration("20151017092134_MyFirstMigration")]
    partial class MyFirstMigration
    {
        // .. more auto-generated code
    }
}

The extra using ; should not be there.

dealdiane avatar Oct 17 '15 09:10 dealdiane

Dupe of #2467

bricelam avatar Oct 17 '15 19:10 bricelam