ArvidsonFoto MVC NET8
1.0.0
Rebuilding of ArvidsonFoto with MVC and .NET8 (upgraded from .NET5 to .NET6 to .NET8)
To start the website, there are a few steps you need to complete.
modelBuilder.InitialDatabaseSeed();
(ca. line 163) in /ArvidsonFoto/Data/ArvidsonFotoDbContext.cs , to be able to create a new database with its associated data.dotnet ef database update --context ArvidsonFotoDbContext
dotnet ef database update --context ArvidsonFotoIdentityContext
To create a new migration if a data model changes, run the command: dotnet-ef migrations add DatabaseSeed --context ArvidsonFotoDbContext
If you get an error message while running: dotnet-ef database update
, which says:
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.
Then you need to install the dotnet-ef CLI (dotnet entity framework), which is installed via the command:
dotnet tool install --global dotnet-ef
Update your dotnet-ef to version 8.0.0 or higher using the command:
dotnet tool update --global dotnet-ef