相关疑难解决方法(0)

更新ASP.NET核心实体框架中的实体类

我使用ASP.NET Core中的Entity Framework从现有数据库创建了模型.

这是Market表格的模型

public partial class Market
{
        public Guid MarketId { get; set; }
        public string City { get; set; }
        public string CityF { get; set; }
        public string Name { get; set; }
        public string NameF { get; set; }
        public int SortOrder { get; set; }
        public bool IsActive { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

但是,我已将MarketId数据类型更改int为数据库中.现在我想更新模型.

找到一些链接,但此链接再次创建整个模型https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db

如何在不创建新模型和使用连接字符串的情况下更新模型appsettings.json

c# entity-framework-core asp.net-core

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

标签 统计

asp.net-core ×1

c# ×1

entity-framework-core ×1