EntityFramework.Core 7.0.0-rc1-final

Prefix Reserved
This is a prerelease version of EntityFramework.Core.
dotnet add package EntityFramework.Core --version 7.0.0-rc1-final                
NuGet\Install-Package EntityFramework.Core -Version 7.0.0-rc1-final                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntityFramework.Core" Version="7.0.0-rc1-final" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EntityFramework.Core --version 7.0.0-rc1-final                
#r "nuget: EntityFramework.Core, 7.0.0-rc1-final"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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