Include function not working with pgsql and .net core 2.1
See original GitHub issueI try to add countries in my address object like this
public IActionResult AllAddress()
{
var AllAddresses = _context.Addresses.Include(a=>a.Country);
var result = new
{
Addresses = AllAddresses
};
return Ok(result);
}
but it just loop and and give me
http://localhost:9807/api/Addresses/all net::ERR_CONNECTION_RESET 200 (OK)
kindly note if I remove include function and return only _context.Addresses
it working fine without any issue ,also I check the database and I am sure every foreign key in address has it’s primary key in country ,
kindly help
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Npgsql.EntityFrameworkCore.PostgreSQL Error when ...
I am using EF Core and Npgsql.EntityFrameworkCore.PostgreSQL inside Azure functions to fetch data from a Postgres Database.
Read more >Postgres Function not working while upgrading .NET Core
Earlier, the same code was working perfectly fine. We are using function instead of stored procedure. DbTransaction transaction = connection.
Read more >Adding EF Core and PostgreSQL to an ASP. ...
In this post I describe how to add PostgreSQL and EF Core to your app, how to build a model, and run migrations...
Read more >ASP.NET Core with PostgreSQL and Entity Framework Core
This article shows how to use PostgreSQL with ASP.NET Core 3.1 using Entity Framework Core.
Read more >Docker: Adding PostgreSQL to .Net Core - Part 2
NET Core is not expecting to work with PostgreSQL – this is the first issue we're going to fix. Adding PostgreSQL to .NET...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You should adjust your JSON serialization settings to ignore circular references, like so:
I’m going to close this issue now, as this is not related to EF Core. Please feel free to continue posting if you have additional questions or issues related to EF Core or the Npgsql provider.
@alrazyreturn wrote:
You do not need to add
Npgsql.EntityFrameworkCore.PostgreSQL.Design
. That package is no longer maintained.@alrazyreturn wrote:
That project is far too involved for us to evaluate. As @roji wrote, we would need a minimal reproduction of this issue in the form of a console application that does not use ASP.NET Core.
Before going any further, try the following and please report back: