Introduction to Entity Framework Core

Introduction to Entity Framework Core

Entity Framework Core also known as EF Core is the latest version of Microsoft’s Entity Framework. It is an Object/Relational Mapping (O/RM) framework, an enhanced version of ADO.NET, that automates data storage and retrieval from the database. EF Core is very powerful and also very easy to learn and use in your projects.

EF Core can be use with with both .NET 4.5+ and .NET Core applications. It runs on all OS – Windows, Mac, Linux.

EF Core Supported Application Types

You can use Entity Framework Core on:

  • 1. Console Applications
  • 2. Windows Applications
  • 3. ASP.NET Web Forms
  • 4. ASP.NET MVC
  • 5. ASP.NET MVC Core
  • 6. WPF
  • 7. Xamarin Framework.
  • 8. Web API

EF Core Versions

EF Core Version Release Date
EF Core 2.0 August 2017
EF Core 1.1 November 2016
EF Core 1.0 June 2016

Working on EF Core

There are 2 approaches when doing development in EF Core. These are:

  • 1. Database First.
  • 2. Code First.

There is very little support of Database First approach since there is no visual designer, like .edmx file, in EF Core.

The EF Core mainly supports Code First approach.

Database First Approach

In Database First approach the domain & context classes are created based on the existing Database.

Code First Approach

In Code First approach the domain & context classes are created by you then EF Core created the database using these classes. The term Migration is used whenever EF Core creates or updates the Database based on the domain & context classes.

EF Core approaches

Entity Framework Core Features

Some important features of EF Core are:

  • 1. DbContext & DbSet
  • 2. LINQ Support
  • 3. Tracking
  • 4. Migrations
  • 5. Batch Insert, Update and Delete operations

Supported Databases

Entity Framework Core works on many databases like:

1. SQL Server
2. MySQL
3. PostgreSQL
4. SQLite
5. SQL Compact

Oracle is currently integrating EF Core on their database. The work is expected to complete soon.

Share this article -

yogihosting

ABOUT THE AUTHOR

This article has been written by the Technical Staff of YogiHosting. Check out other articles on "WordPress, SEO, jQuery, HTML" and more.