我需要更改 EF Core 中代碼首先生成的列的順序。我試過洗掉資料庫并用dotnet ef database update命令重新創建它,但它保持了這個奇怪的順序。有沒有辦法在不應用屬性的情況下修復訂單?

uj5u.com熱心網友回復:
EF Core 6 有這種可能性https://github.com/dotnet/EntityFramework.Docs/issues/3469
builder.Property(x => x.Some)
.HasColumnOrder(1);
之前的版本需要通過以下方式定義順序 ColumnAttribute
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/344062.html
標籤:。网 实体框架核心 ef-core-5.0
