ebakircie / Data_Access

Explanation of ORM and Entity Framework with examples.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

- What is ORM?

Object-Relational Mapping is a programming technique which connects programming languages to databases. ORM helps us to execute sql querries without typing them directly like exact sql querries. After ORM is configured, with the help of OOP user can work with the database.

what-is-orm

- Entity Framework

Official Definition: “Entity Framework is an Object-Relational Mapper (ORM) that enables .NET developers to work with a database using .NET objects. It eliminates the need for most of the data-access code that developers usually need to write.”

Some benefits of using Entity Framework are;

  • reduced development time and development cost
  • easy mapping of Business Objects.
  • fast CRUD operations in .NET Applications.

ef-core-dev-approaces

1.Database First;

Database First allows you to reverse engineer a model from an existing database and let user use database as a class object.

Also some example querries

Screenshot_16

2.Code First

In this method after creating objects into classes, we migrate them to the database after we detirmine how they will act such as relations between tables, rules or conventions. This enables the developers to get more control through the code.

About

Explanation of ORM and Entity Framework with examples.


Languages

Language:C# 100.0%