NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime
8.0.4.1
dotnet add package NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime --version 8.0.4.1
NuGet\Install-Package NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime -Version 8.0.4.1
<PackageReference Include="NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime" Version="8.0.4.1" />
paket add NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime --version 8.0.4.1
#r "nuget: NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime, 8.0.4.1"
// Install NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime as a Cake Addin #addin nuget:?package=NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime&version=8.0.4.1 // Install NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime as a Cake Tool #tool nuget:?package=NpgsqlYB.EntityFrameworkCore.YugabyteDB.NodaTime&version=8.0.4.1
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.
This package is a plugin which allows you to use the NodaTime date/time library when interacting with YugabyteDB; this provides a better and safer API for dealing with date and time data.
To use the plugin, simply add UseNodaTime
as below and use NodaTime types in your entity properties:
await using var ctx = new BlogContext();
await ctx.Database.EnsureDeletedAsync();
await ctx.Database.EnsureCreatedAsync();
// Insert a Blog
ctx.Blogs.Add(new()
{
Name = "FooBlog",
CreationTime = SystemClock.Instance.GetCurrentInstant()
});
await ctx.SaveChangesAsync();
// Query all blogs created in 2020 or after
var newBlogs = await ctx.Blogs.Where(b => b.CreationTime >= Instant.FromUtc(2020, 1, 1, 0, 0, 0)).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;",
o => o.UseNodaTime());
}
public class Blog
{
public int Id { get; set; }
public string Name { get; set; }
public Instant CreationTime { get; set; }
}
The plugin also supports translating most NodaTime methods and properties into corresponding YugabyteDB date/time operations. For more information, see the NodaTime plugin documentation page.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
net8.0
- NpgsqlYB.EntityFrameworkCore.YugabyteDB (>= 8.0.4.1)
- NpgsqlYugabyteDB (>= 8.0.3.2)
- YBNpgsql.NodaTime (>= 8.0.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.4.1 | 97 | 11/25/2024 |
8.0.4-yb-1-preview | 68 | 7/12/2024 |