2017-08-29 07:54:12 +08:00
|
|
|
<a name="scaffold"></a>
|
|
|
|
### Scaffold the Movie model
|
|
|
|
|
|
|
|
* Open a command window in the project directory (The directory that contains the *Program.cs*, *Startup.cs*, and *.csproj* files).
|
|
|
|
* Run the following command:
|
|
|
|
|
|
|
|
```console
|
|
|
|
dotnet aspnet-codegenerator razorpage -m Movie -dc MovieContext -udl -outDir Pages\Movies --referenceScriptLibraries
|
|
|
|
```
|
2017-11-16 06:03:32 +08:00
|
|
|
|
|
|
|
If you get the error:
|
|
|
|
```
|
|
|
|
No executable found matching command "dotnet-aspnet-codegenerator"
|
|
|
|
```
|
|
|
|
|
|
|
|
Open a command window in the project directory (The directory that contains the *Program.cs*, *Startup.cs*, and *.csproj* files).
|
2017-08-29 07:54:12 +08:00
|
|
|
|
|
|
|
If you get the error:
|
|
|
|
```
|
|
|
|
The process cannot access the file
|
|
|
|
'RazorPagesMovie/bin/Debug/netcoreapp2.0/RazorPagesMovie.dll'
|
|
|
|
because it is being used by another process.
|
|
|
|
```
|
|
|
|
|
|
|
|
Exit Visual Studio and run the command again.
|