<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br" -->

---
title: EF Core navigation property returning null? Here's why
description: Navigation properties in EF Core come back null unless you explicitly add Include() to your queries, since EF Core doesn't load related entities automatically....
canonical: https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: EF Core navigation property returning null? Here's why | daily.dev
og:description: Navigation properties in EF Core come back null unless you explicitly add Include() to your queries, since EF Core doesn't load related entities automatically....
og:url: https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br
og:image: https://api.daily.dev/og/posts/riEySn8BR.png
og:image:alt: EF Core navigation property returning null? Here's why
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# EF Core navigation property returning null? Here's why

**[Round The Code](https://daily.dev/sources/roundthecode)** · 8 min read · 0 upvotes · 0 comments

## Summary

Navigation properties in EF Core come back null unless you explicitly add Include() to your queries, since EF Core doesn't load related entities automatically. The piece walks through fixing this with Include(), avoiding circular reference JSON errors from bidirectional navigation properties using ReferenceHandler.IgnoreCycles, configuring explicit joins for 1-to-0..1 relationships, using Select() projections to DTOs instead of Include() for better performance, and avoiding the cartesian explosion problem from multiple Includes by using AsSplitQuery().

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.roundthecode.com/dotnet-tutorials/ef-core-navigation-property-returning-null-heres-why>

## Questions this post answers

### Why does my EF Core navigation property return null even though the foreign key is populated?

Navigation properties stay null by default because EF Core does not load related entities automatically, even when the foreign key column like BlogId is populated. Add Include() to the query, for example _dbContext.Posts.Include(x => x.Blog), to make EF Core join against the Blog table and populate the navigation property in the result.

_Developers debugging missing related data in EF Core track fixes like this one on daily.dev._

### How do I fix the 'possible object cycle was detected' JsonException with EF Core navigation properties?

This happens when bidirectional navigation properties (like Post referencing Blog, and Blog referencing a Posts collection) create a loop that the JSON serializer cannot traverse past its depth limit. Configure JsonSerializerOptions.ReferenceHandler to ReferenceHandler.IgnoreCycles, either in AddJsonOptions for controllers or ConfigureHttpJsonOptions for minimal APIs, to break the cycle during serialization.

_Anyone wiring up circular EF Core relationships to an API response can find serialization fixes like this via daily.dev._

### Why do EF Core queries get slow when using multiple Include() calls on related collections?

Multiple Include() calls on separate collections (for example including both Posts and Subscribers on a Blog) cause a single SQL query to join across all collections at once, multiplying rows and causing performance degradation as tables grow, known as the cartesian explosion problem. Adding AsSplitQuery() splits this into separate SQL queries per Include(), trading one round trip for multiple smaller ones to avoid row multiplication.

_Teams tuning EF Core query performance under growing data volumes can surface guidance like this through daily.dev._

## Similar posts on daily.dev

- [The N\+1 Query Problem in EF Core: Detection, Diagnosis, and Permanent Fixes - Chris Woody Woodruff](https://daily.dev/posts/the-n-1-query-problem-in-ef-core-detection-diagnosis-and-permanent-fixes---chris-woody-woodruff-1wjglh6js) · We Are .NET · 4 upvotes · 0 comments
- [6 EF Core Query Mistakes That Get Expensive in Production](https://daily.dev/posts/6-ef-core-query-mistakes-that-get-expensive-in-production-5cpkulovz) · Waseem .NET Newsletter · 9 upvotes · 0 comments
- [How to Fix Slow EF Core Queries: Practical Performance Tuning](https://daily.dev/posts/how-to-fix-slow-ef-core-queries-practical-performance-tuning-effrdqtga) · Syncfusion · 38 upvotes · 0 comments
- [EF Core Plugins: When Migrations Go Wrong — Daily DevOps & .NET](https://daily.dev/posts/ef-core-plugins-when-migrations-go-wrong-daily-devops-net-tonjsxygr) · Daily DevOps & .NET · 18 upvotes · 1 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"EF Core navigation property returning null? Here's why","url":"https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br"},"datePublished":"2026-10-04T13:07:08.327Z","dateModified":"2026-10-04T13:19:26.025Z","description":"Navigation properties in EF Core come back null unless you explicitly add Include() to your queries, since EF Core doesn't load related entities automatically....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8cd5c6ad43c6a116d7eb8afa36071e1f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8cd5c6ad43c6a116d7eb8afa36071e1f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Round The Code","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Round The Code","logo":"https://media.daily.dev/image/upload/s--HmwWBSI1--/f_auto,q_auto/v1791119052/logos/roundthecode?_a=BAMAMicg0","url":"https://daily.dev/sources/roundthecode"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,c#","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Round The Code","item":"https://daily.dev/sources/roundthecode"},{"@type":"ListItem","position":3,"name":"EF Core navigation property returning null? Here's why"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ef-core-navigation-property-returning-null-here-s-why-rieysn8br#faq","mainEntity":[{"@type":"Question","name":"Why does my EF Core navigation property return null even though the foreign key is populated?","acceptedAnswer":{"@type":"Answer","text":"Navigation properties stay null by default because EF Core does not load related entities automatically, even when the foreign key column like BlogId is populated. Add Include() to the query, for example _dbContext.Posts.Include(x => x.Blog), to make EF Core join against the Blog table and populate the navigation property in the result. Developers debugging missing related data in EF Core track fixes like this one on daily.dev."}},{"@type":"Question","name":"How do I fix the 'possible object cycle was detected' JsonException with EF Core navigation properties?","acceptedAnswer":{"@type":"Answer","text":"This happens when bidirectional navigation properties (like Post referencing Blog, and Blog referencing a Posts collection) create a loop that the JSON serializer cannot traverse past its depth limit. Configure JsonSerializerOptions.ReferenceHandler to ReferenceHandler.IgnoreCycles, either in AddJsonOptions for controllers or ConfigureHttpJsonOptions for minimal APIs, to break the cycle during serialization. Anyone wiring up circular EF Core relationships to an API response can find serialization fixes like this via daily.dev."}},{"@type":"Question","name":"Why do EF Core queries get slow when using multiple Include() calls on related collections?","acceptedAnswer":{"@type":"Answer","text":"Multiple Include() calls on separate collections (for example including both Posts and Subscribers on a Blog) cause a single SQL query to join across all collections at once, multiplying rows and causing performance degradation as tables grow, known as the cartesian explosion problem. Adding AsSplitQuery() splits this into separate SQL queries per Include(), trading one round trip for multiple smaller ones to avoid row multiplication. Teams tuning EF Core query performance under growing data volumes can surface guidance like this through daily.dev."}}]}
```

