Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
53 views

I'm trying to map some enums in my model to PostgreSQL custom enum types using EF Core, but no matter what I do, EF Core keeps sending the values as integers instead of using the PostgreSQL enum type. ...
Henrique Miranda's user avatar
2 votes
2 answers
112 views

We are using .NET 10 and the following NuGet packages: Microsoft.EntityFrameworkCore 10.0.3 Microsoft.EntityFrameworkCore.Design 10.0.3 Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0 We have a simple ...
Aleks Vujic's user avatar
  • 2,360
0 votes
0 answers
116 views

I am using the Bulk Update APIs, part of EF Core like the ExecuteUpdateAsync() functions, to perform updates, and I am passing in a lambda for my valueExpression. I am wondering if the evaluation of ...
bssskpbmb-629801's user avatar
3 votes
0 answers
87 views

I've been using Npgsql, which uses the DbDataSource abstraction. It's really nice since commands created by it do not need explicit connections to be opened by them. However, the equivalent code using ...
Adam's user avatar
  • 1,256
2 votes
1 answer
128 views

I want to use a json function of PostgreSQL, that is not part of NpgsqlJsonDbFunctionsExtensions [DbFunction("jsonb_extract_path_text", IsBuiltIn = true)] public static string JsonExtract(...
ZorgoZ's user avatar
  • 3,746
2 votes
1 answer
153 views

I am encountering a duplicate key value violates unique constraint error in my ASP.NET Core application, and while I understand why it happens, I am unsure about the best practice to handle it using ...
amg63's user avatar
  • 45
1 vote
0 answers
85 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 ...
Мирон Никитин's user avatar
0 votes
0 answers
109 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 ...
ZorgoZ's user avatar
  • 3,746
1 vote
1 answer
126 views

I am working with EF Core 6.0 Web APi. Npgsql.EntityFrameworkCore.PostgreSQL 6.0.29 PostgreSQL 16.3 I have database (Postgres) with musical entities and lessons. Lessons related to musical entities by ...
Александр Васильев's user avatar
0 votes
0 answers
60 views

When I ran a scaffold command on my NPGSQL db with the typical default format I find on the web: Scaffold-DbContext <connection-string> OutputDir Models -Force It created all my model classes ...
Trant's user avatar
  • 3,671
1 vote
0 answers
42 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 ...
nicolitre's user avatar
0 votes
1 answer
123 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 ...
Merijn's user avatar
  • 751
0 votes
1 answer
317 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 ...
thran's user avatar
  • 196
0 votes
0 answers
90 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, ...
Honorius's user avatar
1 vote
1 answer
130 views

I attempt to call two functions to retrieve data from a Postgres database like so: SomeClass.cs public static IDatabaseProvider DatabaseProvider { get; } = new PgDatabaseProvider(); public async Task ...
aleclouisgrant's user avatar
1 vote
0 answers
113 views

The code documentation for DatabaseFacade.AutoSavepointsEnabled warns that: Setting this value to false should only be done with caution since the database could be left in a corrupted state if ...
DVN237294's user avatar
0 votes
1 answer
65 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; } } ...
Sebastian Weber's user avatar
1 vote
0 answers
63 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: ...
Bill Barry's user avatar
  • 3,583
1 vote
1 answer
143 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")....
Hille's user avatar
  • 2,379
1 vote
1 answer
273 views

I'm using Entity Framework Core 9 with PostgreSQL via Npgsql, and I frequently write the following query pattern to perform accent-insensitive and case-insensitive searches: EF.Functions.ILike(EF....
Max Bündchen's user avatar
0 votes
0 answers
209 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: ...
geothachankary's user avatar
0 votes
1 answer
154 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 ...
Andrus's user avatar
  • 28.3k
1 vote
2 answers
71 views

I have prepared a DB fiddle for my questions and also list my SQL code below. I have created a countries_boundaries table, which I intend to fill with .poly files provided at Geofabrik: CREATE ...
Alexander Farber's user avatar
0 votes
1 answer
79 views

Code do $$BEGIN perform pg_create_logical_replication_slot('test', 'pgoutput', false); END$$ ; create publication Jalgi_pub for all tables; select * from pg_logical_slot_peek_binary_changes('test', ...
Andrus's user avatar
  • 28.3k
0 votes
0 answers
95 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 ...
Camilo Terevinto's user avatar
0 votes
0 answers
76 views

Replication events are displayed by ASP.NET Core 9 MVC controller according using code: public async Task Index() { const string slotName = "all_slot"; await ctx.Database....
Andrus's user avatar
  • 28.3k
0 votes
1 answer
82 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 ...
Magnus's user avatar
  • 83
1 vote
0 answers
61 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<...
Christian Klauser's user avatar
0 votes
1 answer
88 views

I'd like to execute a specific SQL command each time after the connection to the database was successful using Entity Framework Core 9 with the Npgsql Entity Framework Core Provider. More specifically,...
belidzs's user avatar
  • 154
0 votes
0 answers
98 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: ...
Vivek's user avatar
  • 39
3 votes
0 answers
385 views

I have a bunch of enums in my Postgres database, and for now I always parsed the enums manually from string to the effective value inside my .NET code (first map to string and then convert). While ...
kevingoos's user avatar
  • 4,538
1 vote
0 answers
76 views

I am trying to call a PostgreSQL stored procedure with OUT parameters from my .NET Core 3.1 API to delete a record based on an ID. However, when I attempt to execute the stored procedure with OUT ...
yaminisai's user avatar
0 votes
1 answer
141 views

I'm working with Npgsql and and Dapper I have some tables in PostgreSql with a composite data type: create type datetimeoffset as ( "DateTimeUtc" timestamp without time zone, "...
Yván Ecarri's user avatar
  • 1,760
6 votes
1 answer
969 views

I am currently working on a database table, that shall contain some base properties of the data and one property that is a jsonb column in the database that can contain different objects that are ...
Octoate's user avatar
  • 539
0 votes
0 answers
79 views

I'm building an application, using .NET (8), EF Core (8) and Postgres (16). I use nodaTime for every date or time related task and NodaTime.Periods are stored in pg as interval. I configure them ...
Joshit's user avatar
  • 1,347
0 votes
0 answers
59 views

We are using a single database with a shared schema multi-tenancy model, as it is the most practical way to support a large number of tenants. Is there a recommended pattern or approach in Npgsql to ...
Neeraj's user avatar
  • 1
0 votes
0 answers
80 views

My program in C# using Entity Framework Core I can point to a PostgreSQL or SQLite database. When pointed to PostgreSQL the Database tool of Performance Analyzer does not work. There only appear ...
Zachary Mollohan's user avatar
0 votes
0 answers
67 views

We're using Hot Chocolate 14. .Net + EF Core 8, and PostgreSQL 13... I'd like to build a custom sort convention... but I haven't found any examples after scouring the internet. The first example is ...
aKillaBlitz's user avatar
0 votes
1 answer
202 views

We have an existing Database First (e.g. Scaffolded) .Net 6 project attached to PostgreSQL 13 DB. The DB has a lot of timestamptz aka TIMESTAMP WITH TIMEZONE fields. So we use NodaTime. Time(!) came ...
aKillaBlitz's user avatar
0 votes
1 answer
93 views

I am using the following code with npgsql 9.0.2 inside a .net 8 web api to insert records into a table, but I am having some trouble where my database gets completely overloaded with the CPU hovering ...
Paul's user avatar
  • 119
1 vote
0 answers
132 views

I am struggling to get documents expiring in less than 90 days: var query = from doc in context.Documents where doc.ExpirationDate <= DateOnly.FromDateTime(DateTime.Today.AddDays(90)) ...
acmoune's user avatar
  • 3,473
0 votes
0 answers
36 views

Been fighting with this for some time. Normally got around this running a local copy of my database on my local machine to get around all of the Google/SSL insanity. Burned myself on at least one ...
Shane Brodie's user avatar
1 vote
0 answers
45 views

I have the following PostgreSQL "function1" function1(par1 Enum_1), function1(par1 integer), ... function1(par1 text) In Npgsql V 3.2.7, the parameters could be created together with the ...
Ruebezaehler's user avatar
2 votes
0 answers
108 views

I have an ASP.NET Core Web API using EF Core. I'm trying to implement timeout middleware as shown here: public async Task InvokeAsync(HttpContext context, RequestDelegate next) { int ...
radoll's user avatar
  • 21
0 votes
1 answer
144 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;...
Kiko's user avatar
  • 357
0 votes
1 answer
109 views

I have been exploring how to access Postgres from C#. When using prepared statements ( which I almost always want to do) the website recommends the following: Create a connection the db ...
John Chenault's user avatar
0 votes
1 answer
84 views

Passing tstzrange to postgres in EF Core using DateTime algus = DateTime.Parse("2024-11-25T00:00:00+02:00", CultureInfo.InvariantCulture).ToUniversalTime(); DateTime lopp = DateTime.Parse(&...
Andrus's user avatar
  • 28.3k
-1 votes
2 answers
182 views

I'm using PostgreSQL with a .NET project, and I'm facing an issue executing a stored procedure through Dapper when using dynamic parameters to pass a DATE parameter. The stored procedure is defined as ...
Hemanth Kumar Chilamkurthi's user avatar
0 votes
0 answers
158 views

I have an ASP.NET Core 8 MVC application. In production the application throws an error Npgsql.PostgresException (0x80004005): 08P01: no more connections allowed (max_client_conn) I am using NPGSQL ...
entity hassle's user avatar
0 votes
1 answer
204 views

I'd like to make a Version-backed column in the database and order by it in queries, keeping the ordering consistent with what would be the result if run on the client directly. There are many entity ...
ZzZombo's user avatar
  • 966

1
2 3 4 5
44