无法在 RapidBlazor 干净架构 EF 7.0 中使用添加迁移

问题描述 投票:0回答:0

使用 https://github.com/jasontaylordev/RapidBlazor 模板 我正在尝试通过添加附加参数来扩展 ApplicationUser 类。

public class ApplicationUser : IdentityUser
{
    public string? MoreInfo { get; set; }
}

当我运行 Add-Migration 或尝试 Update-Database 时,我得到 System.Reflection.TargetInitationException:调用目标已抛出异常。 2> ---> System.AggregateException:发生一个或多个错误。 (列名“MoreInfo”无效。) 2> ---> Microsoft.Data.SqlClient.SqlException (0x80131904): 无效的列名“MoreInfo”。 2> 在 Microsoft.Data.SqlClient.SqlCommand.<>c.b__208_0(任务`1 结果)

仅当我首先在数据库中创建列时,才会显示“构建成功”。 我也无法创建新表....

如何更改此模板或解决此问题?

.net entity-framework blazor core
© www.soinside.com 2019 - 2024. All rights reserved.