Back to directory
dotnet avatar

efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/dotnet/efcore.git

14,777

Stars

3,403

Forks

857

Watchers

MIT

License

Repository

build status test results

This repository is home to the following .NET Foundation projects. These projects are maintained by Microsoft and licensed under the MIT License.

EF Entity Framework Core

latest version preview version downloads

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MariaDB, MySQL, PostgreSQL, and other databases through a provider plugin API.

Installation

EF Core is available on NuGet. Install the provider package corresponding to your target database. See the list of providers in the docs for additional databases.

dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
dotnet add package Microsoft.EntityFrameworkCore.Cosmos

Use the --version option to specify a preview version to install.

Daily builds

We recommend using the daily builds to get the latest code and provide feedback on EF Core. These builds contain latest features and bug fixes; previews and official releases lag significantly behind.

Basic usage

The following code demonstrates basic usage of EF Core. For a full tutorial configuring the DbContext, defining the model, and creating the database, see getting started in the docs.

using var db = new BloggingContext();

// Inserting data into the database
db.Add(new Blog { Url = "http://blogs.msdn.com/adonet" });
db.SaveChanges();

// Querying
var blog = db.Blogs
    .OrderBy(b => b.BlogId)
    .First();

// Updating
blog.Url = "https://devblogs.microsoft.com/dotnet";
blog.Posts.Add(
    new Post
    {
        Title = "Hello World",
        Content = "I wrote an app using EF Core!"
    });
db.SaveChanges();

// Deleting
db.Remove(blog);
db.SaveChanges();

Build from source

Most people use EF Core by installing pre-built NuGet packages, as shown above. Alternatively, the code can be built and packages can be created directly on your development machine.

Contributing

We welcome community pull requests for bug fixes, enhancements, and documentation. See How to contribute for more information.

Getting support

If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an issue. For more details, see getting support.

Microsoft.Data.Sqlite

latest version preview version downloads

Microsoft.Data.Sqlite is a lightweight ADO.NET provider for SQLite. The EF Core provider for SQLite is built on top of this library. However, it can also be used independently or with other data access libraries.

Installation

The latest stable version is available on NuGet.

dotnet add package Microsoft.Data.Sqlite

Use the --version option to specify a preview version to install.

Daily builds

We recommend using the daily builds to get the latest code and provide feedback on Microsoft.Data.Sqlite. These builds contain the latest features and bug fixes; previews and official releases lag significantly behind.

Basic usage

This library implements the common ADO.NET abstractions for connections, commands, data readers, and so on. For more information, see Microsoft.Data.Sqlite on Microsoft Docs.

using var connection = new SqliteConnection("Data Source=Blogs.db");
connection.Open();

using var command = connection.CreateCommand();
command.CommandText = "SELECT Url FROM Blogs";

using var reader = command.ExecuteReader();
while (reader.Read())
{
    var url = reader.GetString(0);
}

Build from source

Most people use Microsoft.Data.Sqlite by installing pre-built NuGet packages, as shown above. Alternatively, the code can be built and packages can be created directly on your development machine.

Contributing

We welcome community pull requests for bug fixes, enhancements, and documentation. See How to contribute for more information.

Getting support

If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an issue. For more details, see getting support.

See also

Releases

Aug 11, 2026

.NET 10.0.11

Download .zip

Release What's Changed

[release/10.0] Source code updates from dotnet/dotnet by @dotnet-maestro[bot] in #38453 [release/10.0] Source code updates from dotnet/dotnet by @dotnet-maestro[bot] in #38475...

Aug 11, 2026

.NET 9.0.19

Download .zip

Release What's Changed

[release/9.0] Update branding to 9.0.19 by @dotnet-bot in #38564 [release/9.0]: Bump Microsoft.Azure.Cosmos from 3.49.0 to 3.61.0 by @dependabot[bot] in #38529 [release/9.0]: B...

Aug 11, 2026

.NET 8.0.30

Download .zip

Release What's Changed

[release/8.0] Update Windows CI images to 2022 by @AndriySvyryd in #38526 [release/8.0] Update branding to 8.0.30 by @dotnet-bot in #38563 [release/8.0]: Bump Microsoft.Data.Sq...

Jul 15, 2026

.NET 10.0.10

Download .zip

Release What's Changed

[release/9.0] Update dependencies from dotnet/arcade by @dotnet-maestro[bot] in #38170 [release/8.0] Update dependencies from dotnet/arcade by @dotnet-maestro[bot] in #38204 Up...

Jul 14, 2026

.NET 8.0.29

Download .zip

Release What's Changed

[release/8.0] Update dependencies from dotnet/arcade by @dotnet-maestro[bot] in #38334 Update branding to 8.0.29 by @vseanreesermsft in #38349 [release/8.0] Add @wtgodbe to COD...

Contributors

ajcvickers avatar ajcvickers 2,380 commits dotnet-maestro[bot] avatar dotnet-maestro[bot] 2,316 commits AndriySvyryd avatar AndriySvyryd 1,965 commits smitpatel avatar smitpatel 1,693 commits bricelam avatar bricelam 1,345 commits roji avatar roji 1,007 commits dotnet-bot avatar dotnet-bot 848 commits maumar avatar maumar 836 commits anpete avatar anpete 739 commits dougbu avatar dougbu 363 commits

300 contributors by commits. Profile dekhne ke liye kisi bhi developer par click karein.