Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
45 views

I've been struggling for two days with a PostgreSQL enum type issue in Entity Framework Core. Despite all my configuration, EF Core keeps trying to send a string (`text`) to an enum column. The ...
0 votes
0 answers
153 views

I'm creating a client-server chat application using WCF. To connect I use the same code as for my other app, but it doesn't work here. This is part of my Code Client: private void bReg_Click(object ...
0 votes
0 answers
54 views

version info. gpdb (postgresql): 6.X npgsql : 4.0.10 .net framework : 4.8 IIS The issue is that when I open only one port on IIS and run the app, it works fine. But when I open two ports, I keep ...
0 votes
1 answer
132 views

I am trying to create a stpored procedure via Npsql from C# private async Task TestExecute(string cmdQuery) { var cnnString = $"Server=localhost;User Id=admin;Password=somepass;...
0 votes
0 answers
56 views

I have a nested entity, defined like this: entity.OwnsOne(e => e.EncryptedElements, o => { o.ToJson(); o.OwnsMany(x => x.Values, o => { o.Property(x ...
24 votes
4 answers
37k views

I have an Azure website in development that connects to a new Azure Postgresql database. This error seemed to have started over the weekend. It was working fine the last time I tried it on Friday. ...
1 vote
0 answers
36 views

I have an Azure Postgres flexible server sitting in a VNet divided into multiple subnets. In a distinct subnet lies an azure app service I am trying to run by publishing it via gitlab. However shortly ...
0 votes
1 answer
91 views

I'm using Hilo with a custom sequence name. When creating migrations, EF Core always creates a migration to drop the sequence with the normal name. Since EF Core 9.0, this produces a runtime exception ...
6 votes
1 answer
14k views

We have a table having one of the columns as a text datatype and having only 3 records. We execute an Update query on text column using ExecuteNonQuery() and it throws an error "Exception while ...
0 votes
1 answer
180 views

I've written a BaseEntity class which defines common fields in my database. It looks something like this: public abstract class BaseEntity { [Key] public int Id { get; set; } public ...
1 vote
1 answer
777 views

I have this piece of code in program.cs to initialize my pool with 5 connections in my .net6 application using postgres and Npgsql. List<NpgsqlConnection> connections = new List<...
0 votes
0 answers
75 views

I'm creating in VisualStudio for Application 2022 an ETL that is migrating data from a MS-SQL Server table to another in PostgreSQL DataBase. I create the ADO.NET Destination connection (server IP, ...
114 votes
15 answers
177k views

I have common problem. Cannot write DateTime with Kind=UTC to PostgreSQL type 'timestamp without time zone' And I want to enable Legacy Timestamp behavoour as is documented here: https://github.com/...
0 votes
1 answer
51 views

We are using EF Core 8.0 with the Npgsql provider. We have several entities that look similar to this: public class Foo { public Guid TenantId { get; set; } public Guid FooId { get; set; } } ...
12 votes
9 answers
26k views

I have recently installed the EF Core 3.1.6 on a home project using postgresql. I have the connection string, and can add migrations easily with the Package Manager Console. If I run my application ...
1 vote
0 answers
40 views

I have an AccountEntity: public class AccountEntity { public int Id { get; set; } public DateOnly? EstablishedDate { get; set; } //... } which is being added via this configuration: ...
1 vote
1 answer
97 views

I've got a table with the filed string Data { get; set; } of type jsonb: modelBuilder.Entity<LayoutEntity>(b => { b.Property(p => p.Data).IsRequired().HasColumnName("data")....
0 votes
0 answers
141 views

I'm building a .NET Aspire-based application using PostgreSQL with Entity Framework Core. I’m registering my DbContext like this as I am using Aspire.Npgsql.EntityFrameworkCore.PostgreSQL package: ...
1 vote
1 answer
639 views

I am using Code-First project and my database is PostgreSql. When I migrated my project to PostgreSql by using Npgsql v.2.2.7 everything worked fine. I need to use the new version of Npsql. To achieve ...
0 votes
1 answer
126 views

Reading multiple values from a Postgres database using npgsql and EF Core in an ASP.NET Core MVC view: var tulem = await ctx.Database .SqlQuery<(string Klient, int Krediit, int ...
0 votes
0 answers
73 views

I'm trying to follow the npgsql guide to map a class to a JSON column, but I cannot get past the following error: System.InvalidOperationException: The entity type 'MainCategory' is not mapped to a ...
0 votes
1 answer
61 views

I have a case where I first want to run a direct query (using .Database.SqlQuery) to try to obtain an advisory lock. Then run another query using linq. When I run the linq query, it seems it uses ...
6 votes
3 answers
13k views

Using EF-Core for PostgresSQL, I have an entity with a field of type byte but decided to change it to type byte[]. But when I do migrations, on applying the migration file generated, it threw the ...
1 vote
0 answers
47 views

I have a DB entity with a JSONB column, modelled as an owned entity with .ToJson(), as recommended by the Npgsql EF Core documentation. modelBuilder.Entity<Notification>() .OwnsMany<...
0 votes
0 answers
81 views

I have a base class called BaseDbContext. I derived two classes from this: WriteDbContext and ReadDbContext. Both contexts have compiled queries as private members in WriteDbContext and ReadDbContext: ...

1
2 3 4 5
44