PE PRN221 - FA22 - TrialTest - Note
PE PRN221 - FA22 - TrialTest - Note
PE PRN221 - FA22 - TrialTest - Note
IMPORTANT – before you start doing your solution, MUST do the following steps:
1. To do your program, you must use ASP.NET Core Razor Pages. Note that you are not allow to connect
direct to database from Razor Pages, every database connection must be used with Repository and Data
Access Objects. The database connection string must get from appsettings.json file.
In the case your program connects directly to database from Razor Pages, you will get 0 mark.
1. Create Solution in Visual Studio named PRN221PE_FA22_TrialTest_StudentName. Inside the
Solution, Project ASP.NET Core Razor Page named: CandidateManagement_StudentName.
2. Create your MS SQL database named CandidateManagement by running code in script
CandidateManagement.sql.
3. Set the default user interface for your project as Login page.
Note
Install package using Tools NuGet Package Manager Package Manager Console
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 5.0.17
Install-Package Microsoft.EntityFrameworkCore.Tools -Version 5.0.17
Install-Package Microsoft.EntityFrameworkCore.Design -Version 5.0.17
- Connection String
"Server=(local);Uid=sa;Pwd=1234567890;Database=CandidateManagement"
- Use Entity Framework Core to generate Object Model from existing database – CLI
dotnet ef dbcontext scaffold "Server=(local);Uid=sa;Pwd=1234567890;Database=CandidateManagement"
Microsoft.EntityFrameworkCore.SqlServer --output-dir Models