How to use Entity Framework Core in ASP.NET Core 6.0 MVC | Database First Approach



How to use Entity Framework Core in ASP.NET Core 6.0 MVC | Database First Approach

How to use  Entity Framework Core in ASP.NET Core 6.0 MVC | Database First Approach

#entityframeworkcore #dotnetcore #mvc #entityframework #nihiratechiees

This video explains how to use Entity Framework Core 6.0 in ASP.NET CORE 6.0 MVC

Topics covered
=============
1, Add Entity framework to ASP.NET Core MVC using database first approach
2, CRUD operations in ASP.NET Core MVC application

Steps need to follow
=================
1, Create .NET Core application using MVC template.

2, Install the below nugget packages
1, Microsoft.EntityFrameworkCore
2, Microsoft.EntityFrameworkCore.Sqlserver
3, Microsoft.EntityFrameworkCore.Tools
4, Microsoft.Extension.configuration

3, Generate DbContext using scaffold command
Scaffold-DbContext “connectionstring” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

4, Update DbContext object
Scaffold-DbContext “Connectionstring” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -t tablename -f

5, Check the database connectivity
6, Complete CRUD operation using scaffold modal generation

Comments are closed.