NpgsqlYB.EntityFrameworkCore.YugabyteDB 8.0.4-yb-1-preview

This is a prerelease version of NpgsqlYB.EntityFrameworkCore.YugabyteDB.
dotnet add package NpgsqlYB.EntityFrameworkCore.YugabyteDB --version 8.0.4-yb-1-preview                
NuGet\Install-Package NpgsqlYB.EntityFrameworkCore.YugabyteDB -Version 8.0.4-yb-1-preview                
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="NpgsqlYB.EntityFrameworkCore.YugabyteDB" Version="8.0.4-yb-1-preview" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NpgsqlYB.EntityFrameworkCore.YugabyteDB --version 8.0.4-yb-1-preview                
#r "nuget: NpgsqlYB.EntityFrameworkCore.YugabyteDB, 8.0.4-yb-1-preview"                
#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 NpgsqlYB.EntityFrameworkCore.YugabyteDB as a Cake Addin
#addin nuget:?package=NpgsqlYB.EntityFrameworkCore.YugabyteDB&version=8.0.4-yb-1-preview&prerelease

// Install NpgsqlYB.EntityFrameworkCore.YugabyteDB as a Cake Tool
#tool nuget:?package=NpgsqlYB.EntityFrameworkCore.YugabyteDB&version=8.0.4-yb-1-preview&prerelease                

Npgsql Entity Framework Core provider for YugabyteDB

Npgsql.EntityFrameworkCore.YugabyteDB is the open source EF Core provider for YugabyteDB. It allows you to interact with YugabyteDB via the most widely-used .NET O/RM from Microsoft, and use familiar LINQ syntax to express queries. It's built on top of NpgsqlYugabyteDB.

The provider looks and feels just like any other Entity Framework Core provider. Here's a quick sample to get you started:

await using var ctx = new BlogContext();
await ctx.Database.EnsureDeletedAsync();
await ctx.Database.EnsureCreatedAsync();

// Insert a Blog
ctx.Blogs.Add(new() { Name = "FooBlog" });
await ctx.SaveChangesAsync();

// Query all blogs who's name starts with F
var fBlogs = await ctx.Blogs.Where(b => b.Name.StartsWith("F")).ToListAsync();

public class BlogContext : DbContext
{
    public DbSet<Blog> Blogs { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseNpgsql(@"Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase;Load Balance Hosts=true;Topology Keys=cloud1.datacenter1.rack1;Timeout=0;");
}

public class Blog
{
    public int Id { get; set; }
    public string Name { get; set; }
}

Aside from providing general EF Core support for YugabyteDB, the provider also exposes some PostgreSQL-specific capabilities, allowing you to query JSON, array or range columns, as well as many other advanced features.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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 NpgsqlYB.EntityFrameworkCore.YugabyteDB:

Package Downloads
NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime

NodaTime support plugin for YugabyteDB/NpgsqlYugabyteDB Entity Framework Core provider.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.4-yb-1-preview 23 7/12/2024