ArvidsonFoto MVC NET8
1.0.0
การสร้าง ArvidsonFoto ขึ้นมาใหม่ด้วย MVC และ .NET8 (อัปเกรดจาก .NET5 เป็น .NET6 เป็น .NET8)
คุณต้องดำเนินการสองสามขั้นตอนเพื่อเริ่มเว็บไซต์
modelBuilder.InitialDatabaseSeed();
(แคลิฟอร์เนียบรรทัดที่ 163) ใน /ArvidsonFoto/Data/ArvidsonFotoDbContext.cs เพื่อให้สามารถสร้างฐานข้อมูลใหม่ด้วยข้อมูลที่เกี่ยวข้องdotnet ef database update --context ArvidsonFotoDbContext
dotnet ef database update --context ArvidsonFotoIdentityContext
หากต้องการสร้างการย้ายใหม่หากโมเดลข้อมูลมีการเปลี่ยนแปลง ให้รันคำสั่ง: dotnet-ef migrations add DatabaseSeed --context ArvidsonFotoDbContext
หากคุณได้รับข้อผิดพลาดขณะทำงาน: dotnet-ef database update
ซึ่งแจ้งว่า:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a build-in dotnet command.
* You intended to execute a .NET program , but dotnet-ef does not exist.
* You intended to run a global tool, but dotnet-prefixed executable with this name could not be found on the PATH.
จากนั้นคุณจะต้องติดตั้ง dotnet-ef CLI (เฟรมเวิร์กเอนทิตี dotnet) ซึ่งติดตั้งผ่านคำสั่ง:
dotnet tool install --global dotnet-ef
อัปเดต dotnet-ef ของคุณเป็นเวอร์ชัน 8.0.0 หรือสูงกว่าโดยใช้คำสั่ง:
dotnet tool update --global dotnet-ef