gpt4 book ai didi

c# - 如何对 EF Core 2.1 中的继承列进行排序?

转载 作者:太空宇宙 更新时间:2023-11-03 12:12:25 24 4
gpt4 key购买 nike

我使用 EF Core 2.1 创建 SQL Server 数据库,但是数据库列排序不会将继承列放在最后,以下是我的实体代码:

public class Blog
{
public int BlogId { get; set; }
public string Url { get; set; }
}

public class RssBlog : Blog
{
public string RssUrl { get; set; }
}

当前列的顺序是:

1.RssUrl
2.BlodId
3.Url

我希望它在数据库中是这样的:

1.BlodId
2.Url
3.RssUrl

你能告诉我如何修复数据库列的排序吗?谢谢!

我是英语初学者,如果我的单词或句子有问题,我很抱歉。

最佳答案

这是我在 EF Core 2.1 Preview 1 发布时提交的 Entity Framework Core 未解决问题,但尚未修复(当前版本 2.1)。

2018 年 10 月 6 日更新

Entity Framework 核心团队计划在明年年初的 EF Core 3.0 版本中修复此问题。

详情如下:https://github.com/aspnet/EntityFrameworkCore/issues/11314

关于c# - 如何对 EF Core 2.1 中的继承列进行排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51443459/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com