Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite 9.0.0
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 interact with spatial data provided by the PostgreSQL PostGIS extension; PostGIS is a mature, standard extension considered to provide top-of-the-line database spatial features. On the .NET side, the plugin adds support for the types from the NetTopologySuite library, allowing you to read and write them directly to PostgreSQL.
To use the plugin, simply add UseNetTopologySuite
as below and use NetTopologySuite types in your entity properties:
await using var ctx = new BlogContext();
await ctx.Database.EnsureDeletedAsync();
await ctx.Database.EnsureCreatedAsync();
// Insert a Blog
ctx.Cities.Add(new()
{
Name = "FooCity",
Center = new Point(10, 10)
});
await ctx.SaveChangesAsync();
// Query all cities with the given center point
var newBlogs = await ctx.Cities.Where(b => b.Center == new Point(10, 10)).ToListAsync();
public class BlogContext : DbContext
{
public DbSet<City> Cities { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseNpgsql(
@"Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase",
o => o.UseNetTopologySuite());
}
public class City
{
public int Id { get; set; }
public string Name { get; set; }
public Point Center { get; set; }
}
The plugin also supports translating many NetTopologySuite methods and properties into corresponding PostGIS operations. For more information, see the NetTopologySuite plugin documentation page.
No packages depend on Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.
.NET 8.0
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.0)
- Npgsql.NetTopologySuite (>= 9.0.0)
Version | Downloads | Last updated |
---|---|---|
9.0.2 | 1 | 12/15/2024 |
9.0.1 | 1 | 11/26/2024 |
9.0.0 | 3 | 11/26/2024 |
9.0.0-rc.2 | 8 | 10/16/2024 |
9.0.0-rc.1 | 7 | 09/18/2024 |
9.0.0-preview.7 | 8 | 09/02/2024 |
9.0.0-preview.3 | 12 | 04/16/2024 |
9.0.0-preview.2 | 16 | 03/29/2024 |
9.0.0-preview.1 | 11 | 02/16/2024 |
8.0.11 | 3 | 11/26/2024 |
8.0.10 | 7 | 10/18/2024 |
8.0.8 | 7 | 09/28/2024 |
8.0.4 | 13 | 05/23/2024 |
8.0.2 | 10 | 02/20/2024 |
8.0.0 | 14 | 11/24/2023 |
8.0.0-rc.2 | 13 | 10/19/2023 |
8.0.0-rc.1 | 12 | 09/19/2023 |
8.0.0-preview.7 | 15 | 09/10/2023 |
8.0.0-preview.4 | 39 | 06/06/2023 |
8.0.0-preview.3 | 37 | 05/14/2023 |
8.0.0-preview.2 | 29 | 04/04/2023 |
8.0.0-preview.1 | 37 | 04/04/2023 |
7.0.18 | 13 | 05/23/2024 |
7.0.11 | 14 | 09/23/2023 |
7.0.4 | 31 | 06/06/2023 |
7.0.3 | 40 | 04/04/2023 |
7.0.1 | 23 | 01/15/2023 |
7.0.0 | 21 | 12/10/2022 |
7.0.0-rc.2 | 17 | 10/15/2022 |
7.0.0-rc.1 | 29 | 09/25/2022 |
7.0.0-preview.7 | 20 | 08/13/2022 |
7.0.0-preview.6 | 31 | 09/11/2022 |
7.0.0-preview.5 | 22 | 09/11/2022 |
7.0.0-preview.4 | 38 | 09/11/2022 |
7.0.0-preview.3 | 38 | 09/11/2022 |
7.0.0-preview.2 | 26 | 09/11/2022 |
7.0.0-preview.1 | 35 | 09/11/2022 |
6.0.29 | 10 | 05/23/2024 |
6.0.22 | 14 | 09/22/2023 |
6.0.8 | 50 | 01/15/2023 |
6.0.7 | 22 | 09/22/2022 |
6.0.6 | 45 | 09/11/2022 |
6.0.5 | 24 | 09/11/2022 |
6.0.4 | 26 | 09/11/2022 |
6.0.3 | 20 | 06/27/2022 |
6.0.2 | 28 | 09/11/2022 |
6.0.1 | 29 | 09/11/2022 |
6.0.0 | 31 | 09/11/2022 |
6.0.0-rc.2 | 22 | 09/11/2022 |
6.0.0-rc.1 | 15 | 09/11/2022 |
6.0.0-preview7 | 22 | 09/11/2022 |
6.0.0-preview6 | 20 | 09/11/2022 |
6.0.0-preview5 | 24 | 09/11/2022 |
6.0.0-preview4 | 19 | 09/11/2022 |
6.0.0-preview3 | 21 | 09/12/2022 |
6.0.0-preview2 | 26 | 09/11/2022 |
6.0.0-preview1 | 28 | 09/11/2022 |
5.0.10 | 31 | 09/11/2022 |
5.0.7 | 40 | 09/11/2022 |
5.0.6 | 31 | 09/11/2022 |
5.0.5.1 | 29 | 09/11/2022 |
5.0.5 | 24 | 09/11/2022 |
5.0.2 | 31 | 09/11/2022 |
5.0.1 | 18 | 09/11/2022 |
5.0.0 | 41 | 09/11/2022 |
5.0.0-rc2 | 22 | 09/11/2022 |
5.0.0-rc1 | 29 | 09/11/2022 |
5.0.0-preview8 | 19 | 09/11/2022 |
5.0.0-preview7 | 20 | 09/11/2022 |
5.0.0-preview6 | 20 | 09/12/2022 |
5.0.0-preview5 | 41 | 09/11/2022 |
5.0.0-preview4 | 16 | 09/11/2022 |
5.0.0-preview3 | 44 | 09/11/2022 |
5.0.0-preview2 | 21 | 09/11/2022 |
5.0.0-preview.2.20120.8 | 32 | 09/11/2022 |
3.1.18 | 31 | 09/11/2022 |
3.1.11 | 25 | 09/11/2022 |
3.1.4 | 50 | 09/11/2022 |
3.1.3 | 23 | 09/11/2022 |
3.1.2 | 15 | 09/11/2022 |
3.1.1 | 61 | 09/22/2022 |
3.1.0 | 16 | 09/11/2022 |
3.1.0-preview3 | 20 | 09/11/2022 |
3.1.0-preview2 | 60 | 09/11/2022 |
3.0.1 | 18 | 09/11/2022 |
3.0.0 | 37 | 09/11/2022 |
3.0.0-preview9 | 17 | 09/11/2022 |
3.0.0-preview5 | 25 | 09/11/2022 |
3.0.0-preview4 | 31 | 09/11/2022 |
3.0.0-preview3 | 22 | 09/11/2022 |
3.0.0-preview1 | 15 | 09/11/2022 |
2.2.4 | 26 | 09/11/2022 |
2.2.0 | 20 | 09/11/2022 |
2.1.1 | 24 | 09/11/2022 |
2.1.0 | 22 | 09/11/2022 |
2.1.0-rc1 | 20 | 09/11/2022 |