Skip to main content

All Questions

0 votes
1 answer
26 views

Confused about NpgSql connection pooling vs AddDbContextPool

I'm trying to implement database pooling in my .net core application that's connecting to PostgreSql db. While reading documentation on NpgSql, It states that pooling is avaible in the this library (...
Morshed Daud's user avatar
0 votes
0 answers
21 views

MSDataSetGenerator generates references to obsolete type NpgsqlTypes.NpgsqlDbType.TimestampTZ

Like the title says, in my .Net Core 8 project, MSDataSetGenerator generates references to obsolete type TimestampTZ instead of TimestampTz (note the case difference!). Every time I change my .xsd ...
didge's user avatar
  • 315
2 votes
1 answer
65 views

How to correctly use 2 different DbContexts using Entity Framework Core to connect to postgres reader instance, writer instance

I have 2 database (AWS Aurora Postgres) instances - reader instance and writer instance. There are 2 different connection strings for the instances and I want to utilize both instances. I want to use ...
Dev123's user avatar
  • 21
0 votes
0 answers
41 views

Adding a match type to a foreign key with EF Core and Npgsql

When creating a foreign key that references multiple nullable columns in Postgresql it's possible to add a match type of "MATCH FULL" on the foreign key to ensure that all values are either ...
Robert Davey's user avatar
0 votes
0 answers
60 views

EF Core mechanisms in .NET Core to handle concurrency issues

I am just starting to learn about concurrent processing in EF Core to make consistent applications and I have some questions, Microsoft documentation says the following: using var context = new ...
Riyaz Vagapov's user avatar
0 votes
1 answer
68 views

Is there a way to set IP address as primary key with EF Core (Npgsql)

Entity: public class IPAddressInformation { public IPAddress Address { get; set; } // ... } Configuration: public void Configure(EntityTypeBuilder<IPAddressInformation> builder) { ...
Parsa99's user avatar
  • 376
1 vote
2 answers
79 views

How can I modify my EF Core query to include an array conversion

Problem Statement I am using Entity Framework (EF) Core and PostgreSQL. In my target table, there is a JSONB column that might contain a version number. My goal is to sort the query by this version ...
Masoomian's user avatar
  • 752
0 votes
0 answers
8 views

Is it possible to have a secondary mapping of a field(json) in NPGSQL/EF Core for querying purposes only?

I have a very dynamic json data(extracted from a diagnostic tool) and mapping everything is very tedious, and there's a possibility that the data content might change, so I have to store everything. ...
eSPiYa's user avatar
  • 932
0 votes
1 answer
53 views

How to suppress warning about constant primary key? Microsoft.EntityFrameworkCore.Model.Validation[20600]

I have a table defined to have exactly one row, by using a boolean primary key and a unique constraint. The idea behind this was based on this post from ten years ago: One-Row by Brandstetter. This is ...
Joe Ballard's user avatar
0 votes
0 answers
29 views

Can't convert a record from PostgreSQL with EF Core to a usable

I struggle to get the result of a SqlQueryRaw (EF Core) from a PostgreSQL db. I have the following query : select case when ... then (col1, col2) when ... then ...
Antonin P's user avatar
1 vote
1 answer
43 views

PostgreSQL view column NOT NULL is not persist when reverse engineering using Entity Framework Core [duplicate]

I worked with EF Core and SQL Server using database first approach. It is Ok for me to use dotnet-ef CLI for reverse engineering both tables and views. It preserves nullability of select columns from ...
Nguyễn Kỳ Dương Trường's user avatar
0 votes
2 answers
109 views

Dynamically specify which table to query at runtime

I have many tables that can be fetched. Right now, for each table I have a Controller class that gets the request, applies the query params and paging, and finally returns the result. All of them are ...
Parsa99's user avatar
  • 376
0 votes
2 answers
377 views

Conditionally include and filter related entities in EF Core 8

How can I query the Employees and Holidays collections so that even if no holidays are found matching their specified criteria, the employees matching their criteria are still returned? Entities: ...
devklick's user avatar
  • 2,469
1 vote
1 answer
46 views

Is supported string aggregates on Entity Framework Core using NPGSQL?

I'm trying to translate this PostgreSQL query to Linq using Npgsql: var result = _dbContext.Substrates.FromSql(@$"SELECT vs.*, ...
Guillermo Espert's user avatar
0 votes
1 answer
47 views

How to map encrypted DateOnly to text in PostgreS

In an ASP.NET Core 8 Web API, I need to store a C# DateOnly entity property in a PostgreSQL text column after encrypting using Npgsql.EntityFrameworkCore.PostgreSQL (8.0.2) and EntityFrameworkCore....
dwdjo's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
22