0% found this document useful (0 votes)
2 views

basic

The document provides a step-by-step guide for installing Entity Framework Core and setting up a database context in a web application. It includes instructions for creating necessary folders and classes, managing NuGet packages, and executing commands for database migration. Additionally, it outlines the process for adding CRUD operations and views for a student model.

Uploaded by

ASK 011
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

basic

The document provides a step-by-step guide for installing Entity Framework Core and setting up a database context in a web application. It includes instructions for creating necessary folders and classes, managing NuGet packages, and executing commands for database migration. Additionally, it outlines the process for adding CRUD operations and views for a student model.

Uploaded by

ASK 011
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Install entity framework core

Right click on dependencies-> manage newget packages ->browse and install 2 pakages
microsoft.entityframeworkcore.sql.server
Microsoft.entityframeworkcore.tool (responsible for data migration create table)

StudentPortal.web-> create new folder ->Data->add class ->ApplicationDbContext.cs


Shortcuts : ctor+tab

Model->create new folder>Entities->add class->Student.cs


Shortcuts prop + double tab

Appsetting.json

ApplicationDbcontext.cs
Tools->nueget package manager ->package manager console (execuate 2 commands) to create db and table
Hya command chy adahi varche codes complete paije eg initialization
Add-Migration "Initial Migration"
Update-database

Crud operation time

Shortcut : ctrl+.
Right click on controller and add controller StudentsController.cs ->right click on view and add view Add.cshtml

right click on modle-> add class AddStudentViewModel.cs

You might also like