EntityFramework.Core
7.0.0-rc1-final
Prefix Reserved
dotnet add package EntityFramework.Core --version 7.0.0-rc1-final
NuGet\Install-Package EntityFramework.Core -Version 7.0.0-rc1-final
<PackageReference Include="EntityFramework.Core" Version="7.0.0-rc1-final" />
paket add EntityFramework.Core --version 7.0.0-rc1-final
#r "nuget: EntityFramework.Core, 7.0.0-rc1-final"
// Install EntityFramework.Core as a Cake Addin #addin nuget:?package=EntityFramework.Core&version=7.0.0-rc1-final&prerelease // Install EntityFramework.Core as a Cake Tool #tool nuget:?package=EntityFramework.Core&version=7.0.0-rc1-final&prerelease
Entity Framework (EF) Core s a .NET library that provides an object-relational mapping (ORM) framework for .NET developers to work with databases. It supports multiple database providers, including SQL Server, MySQL, PostgreSQL, SQLite, and others.
Getting started
Prerequisites
Make sure to install the same version of all EF Core packages shipped by Microsoft. For example, if version 5.0.3 of Microsoft.EntityFrameworkCore.SqlServer is installed, then all other Microsoft.EntityFrameworkCore.* packages must also be at 5.0.3.
Usage
To use Microsoft.EntityFrameworkCore in your application, you will typically need to create a class that inherits from DbContext, which represents your database context. You can then define classes that represent your database entities, and use LINQ queries to interact with the database.
Here's an example of how you might define a database context and an entity:
using Microsoft.EntityFrameworkCore;
public class MyDbContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
You can then use the MyDbContext class to interact with the database:
using (var context = new MyDbContext())
{
// Add a new customer
context.Customers.Add(new Customer { Name = "John Doe" });
context.SaveChanges();
// Retrieve all customers
var customers = context.Customers.ToList();
}
Microsoft.EntityFrameworkCore supports multiple database providers, including SQL Server, MySQL, PostgreSQL, SQLite, and others. You will need to install the provider package for your chosen database. For example, to use SQL Server, you would install the Microsoft.EntityFrameworkCore.SqlServer package.
You would then configure your database context to use the SQL Server provider:
using Microsoft.EntityFrameworkCore;
public class MyDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MyDatabase;");
}
public DbSet<Customer> Customers { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
Additional documentation
- Getting Started with Entity Framework Core.
- Follow the ASP.NET Core Tutorial to use EF Core in a web app.
- Releases and planning(roadmap)
- How to write an EF Core provider
Feedback
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 Github issue. For more details, see getting support.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net451 is compatible. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
.NETPlatform | dotnet54 is compatible. |
DNX | dnx451 is compatible. |
Universal Windows Platform | netcore50 is compatible. |
-
.NETCore 5.0
- Ix-Async (>= 1.2.5)
- Microsoft.Extensions.Caching.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Caching.Memory (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)
- Remotion.Linq (>= 2.0.1)
- System.Collections.Immutable (>= 1.1.36)
- System.ComponentModel (>= 4.0.0)
- System.ComponentModel.Annotations (>= 4.0.10)
- System.Diagnostics.Debug (>= 4.0.10)
- System.Globalization (>= 4.0.10)
- System.IO (>= 4.0.10)
- System.Linq (>= 4.0.0)
- System.Linq.Expressions (>= 4.0.10)
- System.Linq.Queryable (>= 4.0.0)
- System.ObjectModel (>= 4.0.10)
- System.Reflection (>= 4.0.10)
- System.Reflection.Extensions (>= 4.0.0)
- System.Reflection.TypeExtensions (>= 4.0.0)
- System.Resources.ResourceManager (>= 4.0.0)
- System.Runtime (>= 4.0.20)
- System.Runtime.Extensions (>= 4.0.10)
- System.Threading (>= 4.0.10)
- System.Threading.Tasks (>= 4.0.10)
-
.NETFramework 4.5.1
- Ix-Async (>= 1.2.5)
- Microsoft.Extensions.Caching.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Caching.Memory (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)
- Remotion.Linq (>= 2.0.1)
- System.Collections.Immutable (>= 1.1.36)
-
.NETPlatform 5.4
- Ix-Async (>= 1.2.5)
- Microsoft.Extensions.Caching.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Caching.Memory (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)
- Remotion.Linq (>= 2.0.1)
- System.Collections (>= 4.0.11-beta-23516)
- System.Collections.Concurrent (>= 4.0.11-beta-23516)
- System.Collections.Immutable (>= 1.1.36)
- System.ComponentModel (>= 4.0.1-beta-23516)
- System.ComponentModel.Annotations (>= 4.0.11-beta-23516)
- System.Diagnostics.Debug (>= 4.0.11-beta-23516)
- System.Diagnostics.Tools (>= 4.0.1-beta-23516)
- System.Linq (>= 4.0.1-beta-23516)
- System.Linq.Queryable (>= 4.0.1-beta-23516)
- System.ObjectModel (>= 4.0.11-beta-23516)
- System.Reflection (>= 4.0.10)
- System.Reflection.Extensions (>= 4.0.1-beta-23516)
- System.Resources.ResourceManager (>= 4.0.1-beta-23516)
- System.Runtime (>= 4.0.21-beta-23516)
- System.Runtime.Extensions (>= 4.0.11-beta-23516)
- System.Runtime.InteropServices (>= 4.0.21-beta-23516)
- System.Threading (>= 4.0.11-beta-23516)
- System.Threading.Tasks (>= 4.0.11-beta-23516)
-
DNX 4.5.1
- Ix-Async (>= 1.2.5)
- Microsoft.Extensions.Caching.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Caching.Memory (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection (>= 1.0.0-rc1-final)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging (>= 1.0.0-rc1-final)
- Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)
- Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)
- Remotion.Linq (>= 2.0.1)
- System.Collections.Immutable (>= 1.1.36)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EntityFramework.Core:
Package | Downloads |
---|---|
EntityFramework.Relational
Shared Entity Framework components for relational data stores. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EntityFramework.Core:
Repository | Stars |
---|---|
rowanmiller/UnicornStore
|
Version | Downloads | Last updated |
---|---|---|
7.0.0-rc1-final | 19,461 | 11/18/2015 |
7.0.0-beta8 | 18,256 | 10/15/2015 |
7.0.0-beta7 | 17,504 | 9/2/2015 |
7.0.0-beta6 | 13,431 | 7/27/2015 |
7.0.0-beta5 | 15,652 | 6/30/2015 |
7.0.0-beta4 | 22,405 | 4/24/2015 |
7.0.0-beta3 | 7,442 | 2/13/2015 |
7.0.0-beta2 | 6,802 | 1/16/2015 |