efcore
efcore copied to clipboard
Runnning ef migrations may generate a code that doesn't compile
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.
Dupe of #2467