Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite 9.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 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.

Version Downloads Last updated
10.0.0-preview.3 6 04/13/2025
10.0.0-preview.2 5 03/27/2025
10.0.0-preview.1 9 03/01/2025
9.0.4 7 03/01/2025
9.0.3 7 01/20/2025
9.0.2 13 12/15/2024
9.0.1 10 11/26/2024
9.0.0 15 11/26/2024
9.0.0-rc.2 18 10/16/2024
9.0.0-rc.1 15 09/18/2024
9.0.0-preview.7 17 09/02/2024
9.0.0-preview.3 20 04/16/2024
9.0.0-preview.2 22 03/29/2024
9.0.0-preview.1 16 02/16/2024
8.0.11 13 11/26/2024
8.0.10 13 10/18/2024
8.0.8 18 09/28/2024
8.0.4 19 05/23/2024
8.0.2 14 02/20/2024
8.0.0 20 11/24/2023
8.0.0-rc.2 20 10/19/2023
8.0.0-rc.1 17 09/19/2023
8.0.0-preview.7 21 09/10/2023
8.0.0-preview.4 45 06/06/2023
8.0.0-preview.3 41 05/14/2023
8.0.0-preview.2 34 04/04/2023
8.0.0-preview.1 42 04/04/2023
7.0.18 18 05/23/2024
7.0.11 19 09/23/2023
7.0.4 35 06/06/2023
7.0.3 46 04/04/2023
7.0.1 28 01/15/2023
7.0.0 27 12/10/2022
7.0.0-rc.2 22 10/15/2022
7.0.0-rc.1 35 09/25/2022
7.0.0-preview.7 27 08/13/2022
7.0.0-preview.6 37 09/11/2022
7.0.0-preview.5 27 09/11/2022
7.0.0-preview.4 45 09/11/2022
7.0.0-preview.3 44 09/11/2022
7.0.0-preview.2 32 09/11/2022
7.0.0-preview.1 40 09/11/2022
6.0.29 18 05/23/2024
6.0.22 20 09/22/2023
6.0.8 55 01/15/2023
6.0.7 29 09/22/2022
6.0.6 50 09/11/2022
6.0.5 30 09/11/2022
6.0.4 31 09/11/2022
6.0.3 25 06/27/2022
6.0.2 33 09/11/2022
6.0.1 36 09/11/2022
6.0.0 37 09/11/2022
6.0.0-rc.2 27 09/11/2022
6.0.0-rc.1 21 09/11/2022
6.0.0-preview7 28 09/11/2022
6.0.0-preview6 26 09/11/2022
6.0.0-preview5 29 09/11/2022
6.0.0-preview4 25 09/11/2022
6.0.0-preview3 27 09/12/2022
6.0.0-preview2 32 09/11/2022
6.0.0-preview1 34 09/11/2022
5.0.10 37 09/11/2022
5.0.7 49 09/11/2022
5.0.6 36 09/11/2022
5.0.5.1 34 09/11/2022
5.0.5 30 09/11/2022
5.0.2 36 09/11/2022
5.0.1 24 09/11/2022
5.0.0 47 09/11/2022
5.0.0-rc2 28 09/11/2022
5.0.0-rc1 35 09/11/2022
5.0.0-preview8 26 09/11/2022
5.0.0-preview7 26 09/11/2022
5.0.0-preview6 27 09/12/2022
5.0.0-preview5 47 09/11/2022
5.0.0-preview4 21 09/11/2022
5.0.0-preview3 54 09/11/2022
5.0.0-preview2 27 09/11/2022
5.0.0-preview.2.20120.8 38 09/11/2022
3.1.18 38 09/11/2022
3.1.11 31 09/11/2022
3.1.4 55 09/11/2022
3.1.3 28 09/11/2022
3.1.2 20 09/11/2022
3.1.1 67 09/22/2022
3.1.0 21 09/11/2022
3.1.0-preview3 26 09/11/2022
3.1.0-preview2 65 09/11/2022
3.0.1 23 09/11/2022
3.0.0 42 09/11/2022
3.0.0-preview9 25 09/11/2022
3.0.0-preview5 32 09/11/2022
3.0.0-preview4 38 09/11/2022
3.0.0-preview3 30 09/11/2022
3.0.0-preview1 21 09/11/2022
2.2.4 32 09/11/2022
2.2.0 28 09/11/2022
2.1.1 29 09/11/2022
2.1.0 29 09/11/2022
2.1.0-rc1 25 09/11/2022