© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
21 replies
enrico11011

✅ Accessing associated records through navigation properties

say I had a class like so (I'm using them with EF Core)

    public class Project
    {
        public int Id { get; set; }

        [Column(TypeName="VARCHAR(32)")]
        public string Name { get; set; }
        public bool Original { get; set; }
        public int CreatedOn { get; set; }
        public int UpdatedOn { get; set; }
        public int DeletedOn { get; set; }

        public List<FeedbackRecord> FeedbackRecords { get; set; }
        public List<ManufacturingInstructions> ManufacturingInstructions { get; set; }
        public List<ModelPrototype> ModelPrototypes { get; set; }
        public List<Sketch> Sketches { get; set; }
    }
    public class Project
    {
        public int Id { get; set; }

        [Column(TypeName="VARCHAR(32)")]
        public string Name { get; set; }
        public bool Original { get; set; }
        public int CreatedOn { get; set; }
        public int UpdatedOn { get; set; }
        public int DeletedOn { get; set; }

        public List<FeedbackRecord> FeedbackRecords { get; set; }
        public List<ManufacturingInstructions> ManufacturingInstructions { get; set; }
        public List<ModelPrototype> ModelPrototypes { get; set; }
        public List<Sketch> Sketches { get; set; }
    }


given an instance of
Project
Project
, how would I go about getting the related
FeedbackRecords
FeedbackRecords
,
ManufacturingInstructions
ManufacturingInstructions
,
ModelPrototypes
ModelPrototypes
, and
Sketches
Sketches
? Do I have to go through dbContext? or is there a way to go straight through them model itself (kinda like the way Django does it)?
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

❔ Navigation properties internals. EFCore
C#CC# / help
4y ago
Avoiding circular references in navigation properties
C#CC# / help
2y ago
EF Core - Intermediate table or Navigation Properties?
C#CC# / help
17mo ago