EntityFramework修改欄位名稱
EntityFramework修改欄位名稱
public override void Up()
{
RenameColumn("Travel_OrderTagMapping", "OrderId", "OrderProductId");
//自動產生的 會刪除欄位後 建新的
//AddColumn("dbo.Travel_OrderTagMapping", "OrderProductId", c => c.String(nullable: false, maxLength: 50));
//DropColumn("dbo.Travel_OrderTagMapping", "OrderId");
}
public override void Down()
{
RenameColumn("Travel_OrderTagMapping", "OrderProductId", "OrderId");
//自動產生的
//AddColumn("dbo.Travel_OrderTagMapping", "OrderId", c => c.String(nullable: false, maxLength: 50));
//DropColumn("dbo.Travel_OrderTagMapping", "OrderProductId");
}
輸入大量資料時速度慢
一次新增千筆等級的資料就會開始變慢最好要用 BulkInsert
免費但是沒有維護了 https://github.com/ghost1face/EntityFramework.BulkInsert
免費 活躍中 但是要裝蠻多套件 https://github.com/NorthernLight1/N.EntityFramework.Extensions/
付費套件 https://entityframework-extensions.net/ ( https://entityframework-plus.net/ 的付費版 )
如果內容有誤請多鞭策謝謝