Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime 7.0.4
Npgsql Entity Framework Core provider for PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL is the open source EF Core provider for PostgreSQL. It allows you to interact with PostgreSQL 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 PostgreSQL; 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",
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 PostgreSQL date/time operations. For more information, see the NodaTime plugin documentation page.
No packages depend on Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime.
.NET 6.0
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 7.0.4)
- Npgsql.NodaTime (>= 7.0.4)
Version | Downloads | Last updated |
---|---|---|
9.0.3 | 0 | 01/17/2025 |
9.0.2 | 0 | 12/07/2024 |
9.0.1 | 0 | 11/19/2024 |
9.0.0 | 0 | 11/18/2024 |
9.0.0-rc.2 | 0 | 10/13/2024 |
9.0.0-rc.1 | 0 | 09/13/2024 |
9.0.0-preview.7 | 0 | 09/01/2024 |
9.0.0-preview.3 | 0 | 04/12/2024 |
9.0.0-preview.2 | 0 | 03/22/2024 |
9.0.0-preview.1 | 0 | 02/14/2024 |
8.0.11 | 0 | 11/18/2024 |
8.0.10 | 0 | 10/17/2024 |
8.0.8 | 0 | 09/27/2024 |
8.0.4 | 0 | 05/11/2024 |
8.0.2 | 0 | 02/17/2024 |
8.0.0 | 0 | 11/21/2023 |
8.0.0-rc.2 | 0 | 10/11/2023 |
8.0.0-rc.1 | 0 | 09/14/2023 |
8.0.0-preview.7 | 0 | 08/18/2023 |
8.0.0-preview.4 | 0 | 05/20/2023 |
8.0.0-preview.3 | 0 | 04/24/2023 |
8.0.0-preview.2 | 0 | 03/20/2023 |
8.0.0-preview.1 | 0 | 03/03/2023 |
7.0.18 | 0 | 05/11/2024 |
7.0.11 | 0 | 09/15/2023 |
7.0.4 | 1 | 01/20/2025 |
7.0.3 | 0 | 02/15/2023 |
7.0.1 | 0 | 12/17/2022 |
7.0.0 | 0 | 11/09/2022 |
7.0.0-rc.2 | 0 | 10/11/2022 |
7.0.0-rc.1 | 0 | 09/16/2022 |
7.0.0-preview.7 | 0 | 08/09/2022 |
7.0.0-preview.6 | 0 | 07/13/2022 |
7.0.0-preview.5 | 0 | 06/19/2022 |
7.0.0-preview.4 | 0 | 05/11/2022 |
7.0.0-preview.3 | 0 | 04/19/2022 |
7.0.0-preview.2 | 0 | 03/16/2022 |
7.0.0-preview.1 | 0 | 02/17/2022 |
6.0.29 | 0 | 05/11/2024 |
6.0.22 | 0 | 09/15/2023 |
6.0.8 | 0 | 12/17/2022 |
6.0.7 | 0 | 09/16/2022 |
6.0.6 | 0 | 08/04/2022 |
6.0.5 | 0 | 06/19/2022 |
6.0.4 | 0 | 04/19/2022 |
6.0.3 | 0 | 01/27/2022 |
6.0.2 | 0 | 12/22/2021 |
6.0.1 | 0 | 12/03/2021 |
6.0.0 | 0 | 11/09/2021 |
6.0.0-rc.2 | 0 | 10/14/2021 |
6.0.0-rc.1 | 0 | 09/24/2021 |
6.0.0-preview7 | 0 | 08/16/2021 |
6.0.0-preview6 | 0 | 07/31/2021 |
6.0.0-preview5 | 0 | 07/01/2021 |
6.0.0-preview4 | 0 | 05/27/2021 |
6.0.0-preview3 | 0 | 04/15/2021 |
6.0.0-preview2 | 0 | 03/11/2021 |
6.0.0-preview1 | 0 | 02/16/2021 |
5.0.10 | 0 | 09/15/2021 |
5.0.7 | 0 | 06/13/2021 |
5.0.6 | 0 | 05/11/2021 |
5.0.5.1 | 0 | 04/21/2021 |
5.0.5 | 0 | 04/16/2021 |
5.0.2 | 0 | 01/19/2021 |
5.0.1 | 0 | 12/12/2020 |
5.0.0 | 0 | 11/15/2020 |
5.0.0-rc2 | 0 | 10/15/2020 |
5.0.0-rc1 | 0 | 09/14/2020 |
5.0.0-preview8 | 0 | 08/27/2020 |
5.0.0-preview7 | 0 | 07/22/2020 |
5.0.0-preview6 | 0 | 06/26/2020 |
5.0.0-preview5 | 0 | 06/11/2020 |
5.0.0-preview4 | 0 | 05/19/2020 |
5.0.0-preview3 | 0 | 04/24/2020 |
5.0.0-preview2 | 0 | 04/02/2020 |
5.0.0-preview.2.20120.8 | 0 | 03/20/2020 |
3.1.18 | 0 | 08/27/2021 |
3.1.11 | 0 | 01/21/2021 |
3.1.4 | 0 | 05/29/2020 |
3.1.3 | 0 | 03/26/2020 |
3.1.2 | 0 | 02/20/2020 |
3.1.1 | 0 | 01/31/2020 |
3.1.0 | 0 | 12/04/2019 |
3.1.0-preview3 | 0 | 11/15/2019 |
3.1.0-preview2 | 0 | 11/06/2019 |
3.0.1 | 0 | 10/02/2019 |
3.0.0 | 0 | 09/26/2019 |
3.0.0-preview9 | 0 | 09/04/2019 |
3.0.0-preview8 | 0 | 08/15/2019 |
3.0.0-preview7 | 0 | 07/25/2019 |
3.0.0-preview5 | 0 | 05/06/2019 |
3.0.0-preview4 | 0 | 04/21/2019 |
3.0.0-preview3 | 0 | 03/12/2019 |
3.0.0-preview1 | 0 | 12/16/2018 |
2.2.4 | 0 | 05/21/2019 |
2.2.0 | 0 | 12/07/2018 |
2.1.1 | 0 | 07/01/2018 |
2.1.0 | 0 | 05/31/2018 |
2.1.0-rc1 | 0 | 05/08/2018 |