ArvidsonFoto MVC NET8
1.0.0
Membangun kembali ArvidsonFoto dengan MVC dan .NET8 (ditingkatkan dari .NET5 ke .NET6 ke .NET8)
Untuk memulai situs web, ada beberapa langkah yang perlu Anda selesaikan.
modelBuilder.InitialDatabaseSeed();
(ca. baris 163) di /ArvidsonFoto/Data/ArvidsonFotoDbContext.cs , untuk dapat membuat database baru dengan data terkaitnya.dotnet ef database update --context ArvidsonFotoDbContext
dotnet ef database update --context ArvidsonFotoIdentityContext
Untuk membuat migrasi baru jika model data diubah, jalankan perintah: dotnet-ef migrations add DatabaseSeed --context ArvidsonFotoDbContext
Jika Anda mendapatkan pesan kesalahan saat menjalankan: dotnet-ef database update
, yang berbunyi:
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.
Maka Anda perlu menginstal dotnet-ef CLI (dotnet entitas framework), yang diinstal melalui perintah:
dotnet tool install --global dotnet-ef
Perbarui dotnet-ef Anda ke versi 8.0.0 atau lebih tinggi menggunakan perintah:
dotnet tool update --global dotnet-ef