小编ekg*_*orp的帖子

实体框架核心启用迁移使用错误生成Configuration.cs文件

经历了很多麻烦之后,我运行了Enable-Migrations,我终于正确地使用了命令,以便它在我的项目中创建了Migrations目录。

但是,这是它给我的文件。我已将Using语句移至顶部,并删除了无效的语句,但这就是我所做的全部更改。

错误配置

原始代码。错误在上面的图像链接中。

internal sealed class Configuration : DbMigrationsConfiguration<RapidDeploy.Models.BloggingContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = false;
    }

    protected override void Seed(RapidDeploy.Models.BloggingContext context)
    {
        //  This method will be called after migrating to the latest version.

        //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
        //  to avoid creating duplicate seed data. E.g.
        //
        //    context.People.AddOrUpdate(
        //      p => p.FullName,
        //      new Person { FullName = "Andrew Peters" },
        //      new Person { FullName = "Brice Lambson" },
        //      new Person …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework uwp template10

2
推荐指数
2
解决办法
3111
查看次数

标签 统计

c# ×1

entity-framework ×1

template10 ×1

uwp ×1