© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
15 replies
N_58

Should I use navigation properties in EF Core?

When using EF Core should I always use navigation properties or never?
for example I have:
class Post
{
  public string Content { get; set; }
  public string AuthorId { get; set; }
  public User Author { get; set; } // Should I use it?
}
class Post
{
  public string Content { get; set; }
  public string AuthorId { get; set; }
  public User Author { get; set; } // Should I use it?
}


class User
{
  public string Name { get; set; }
  public ICollection<Post> Posts { get; set; } // Should I use it?
}
class User
{
  public string Name { get; set; }
  public ICollection<Post> Posts { get; set; } // Should I use it?
}


I use .NET 9 in my smaller project and I wonder if it's better to use it or not in terms of performance?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

EF Core - Intermediate table or Navigation Properties?
C#CC# / help
17mo ago
✅ EF Core navigational properties
C#CC# / help
3y ago
Calculated Properties with EF Core
C#CC# / help
2y ago