Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite 9.0.0-preview.3

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
9.0.0-preview.3 2 04/16/2024
9.0.0-preview.2 2 03/29/2024
9.0.0-preview.1 5 02/16/2024
8.0.2 2 02/20/2024
8.0.0 4 11/24/2023
8.0.0-rc.2 3 10/19/2023
8.0.0-rc.1 4 09/19/2023
8.0.0-preview.7 6 09/10/2023
8.0.0-preview.4 25 06/06/2023
8.0.0-preview.3 26 05/14/2023
8.0.0-preview.2 19 04/04/2023
8.0.0-preview.1 24 04/04/2023
7.0.11 4 09/23/2023
7.0.4 18 06/06/2023
7.0.3 23 04/04/2023
7.0.1 11 01/15/2023
7.0.0 13 12/10/2022
7.0.0-rc.2 6 10/15/2022
7.0.0-rc.1 16 09/25/2022
7.0.0-preview.7 13 08/13/2022
7.0.0-preview.6 17 09/11/2022
7.0.0-preview.5 10 09/11/2022
7.0.0-preview.4 22 09/11/2022
7.0.0-preview.3 23 09/11/2022
7.0.0-preview.2 15 09/11/2022
7.0.0-preview.1 22 09/11/2022
6.0.22 7 09/22/2023
6.0.8 32 01/15/2023
6.0.7 12 09/22/2022
6.0.6 28 09/11/2022
6.0.5 14 09/11/2022
6.0.4 16 09/11/2022
6.0.3 9 06/27/2022
6.0.2 16 09/11/2022
6.0.1 16 09/11/2022
6.0.0 17 09/11/2022
6.0.0-rc.2 12 09/11/2022
6.0.0-rc.1 6 09/11/2022
6.0.0-preview7 11 09/11/2022
6.0.0-preview6 8 09/11/2022
6.0.0-preview5 14 09/11/2022
6.0.0-preview4 10 09/11/2022
6.0.0-preview3 10 09/12/2022
6.0.0-preview2 16 09/11/2022
6.0.0-preview1 16 09/11/2022
5.0.10 14 09/11/2022
5.0.7 19 09/11/2022
5.0.6 19 09/11/2022
5.0.5.1 17 09/11/2022
5.0.5 11 09/11/2022
5.0.2 21 09/11/2022
5.0.1 9 09/11/2022
5.0.0 29 09/11/2022
5.0.0-rc2 11 09/11/2022
5.0.0-rc1 15 09/11/2022
5.0.0-preview8 11 09/11/2022
5.0.0-preview7 10 09/11/2022
5.0.0-preview6 10 09/12/2022
5.0.0-preview5 24 09/11/2022
5.0.0-preview4 7 09/11/2022
5.0.0-preview3 27 09/11/2022
5.0.0-preview2 12 09/11/2022
5.0.0-preview.2.20120.8 20 09/11/2022
3.1.18 15 09/11/2022
3.1.11 17 09/11/2022
3.1.4 32 09/11/2022
3.1.3 12 09/11/2022
3.1.2 8 09/11/2022
3.1.1 40 09/22/2022
3.1.0 7 09/11/2022
3.1.0-preview3 10 09/11/2022
3.1.0-preview2 35 09/11/2022
3.0.1 8 09/11/2022
3.0.0 23 09/11/2022
3.0.0-preview9 9 09/11/2022
3.0.0-preview5 14 09/11/2022
3.0.0-preview4 19 09/11/2022
3.0.0-preview3 10 09/11/2022
3.0.0-preview1 7 09/11/2022
2.2.4 15 09/11/2022
2.2.0 11 09/11/2022
2.1.1 13 09/11/2022
2.1.0 10 09/11/2022
2.1.0-rc1 9 09/11/2022