Code and prod logo

Code and Prod Complet Projects

Follow me

EL JIHAOUI
QUICK ACCESS

Entity Framework Core .NET7

Entity Framework Core .NET7

Table of Contents

Entity Framework Core

Most computer projects or applications require communication with a database such as MySQLSQL Server, Oracle, PostgreSQL, etc…. Microsft has a very powerful component that is part of the .NET Core environment, this tool allows us to work with databases in a simple and fast way. we are talking here about the Entity Framework Core component or EF Core.

Entity Framework Core in In .NET 7, is an object-relational mapper (O/RM) that enables .NET developers to work with a database using .NET objects. It eliminates the need for most of the data-access code that typically needs to be written. so it’s a tool that helps .NET developers to interact with databases.

EF Core supports many database engines, making it a great choice for developers who want to work with multiple database engines like SQL Server, SQLite, PostgreSQL, MySQL, etc.

The operation of EF Core can be represented in a simple way as in the diagram below :

Entity Framework core

There are two ways to develop with Entity Framework Core: the Code First approach and the Database First approach.

Code First Approach

In The Code First Approach, EF Core uses migration to create the database and tables based on the conventions and configuration provided in your domain classes/Model. This code-first approach is useful in Domain Driven Design (DDD).

Domain-driven design (DDD) : is a software engineering approach to solving a specific domain model.

In this case, we have one class or multiple classes or entities and using EF core functionality we will transform these entities into materialized tables in the database.

we will discuss the topic “Code First Approach” in this article

Database First Approach

The EF Core database first approach creates the domain and context classes based on your existing database using EF Core commands.

This can be a great way to get started using EF Core if you have an existing database that you want to use with your project.

EF Core is designed for the code-first approach, providing limited support for the database-first approach because the visual designer or wizard for the Database model is not supported as of EF Core 2.0.

Course Video

if you like it share it please

Facebook
LinkedIn
Twitter
Related Posts
Data Seeding in migration using EF Core
Entity Framework Core
EL JIHAOUI

Data seeding

Data seeding is a process where you populate a database with an initial set of data
There are

Read More »

MORE RESSOURCES