Dept Student Create
Dept Student Create
cshtml
Dept and Student
1) Add Dept and Student
class to Models Folders
Dept
Id: int
Dname: string?
Faculty: string?
Student
Id: int
Sname: String?
Gender: String?
Total: int
Email: string?
Password: string?
Simage : string?
2) ApplicationDbContext
3) Program.cs
4) Migration
• Tools Nuget Package Manager Package Manager Console
• Add-Migration step1
• Update-Database
5) Add Controller with View using EF
(Dept / Student)
• Controllers Add Controller
• MVC Controller with Views using EF
• Model Name : Dept
• DBContext: ApplicationDBContext
• Controller Name : DeptsControllers (by Default)
• Add
Database
2
Create.cshtml
Design
DeptControllers
Dept Page
Depts.Index Depts.Create
Part 2: Create.cshtml (Student)
Create.cshtml (Structure)
Student
Database
2
StudentViewModel
1
1) Create new Class (Models)
StudentViewModel
2) re-Design Create.cshtml
2) re-Design Create.cshtml
2) re-Design Create.cshtml
3) studentsControllers
Index