© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
85 replies
big OOF

✅ API result

Hello,

I have two tables, group and person. These are created in Sqlite using EntityFramework and therefore the i have two classes like this:
public class Group
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
public class Group
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }


public class Person
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public ICollection<Group> Group{ get; set; }
    }
public class Person
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public ICollection<Group> Group{ get; set; }
    }


From what i understand the line: "public ICollection<Group> Group{ get; set; }" creates a relation between the two tables(the id) when created by EF.

So to my question - when i try to retrieve Person via API(postman) i only get Id and Name. The goal is to get The person object but with Group nested in the JSON response.

Is there a step im missing? 🙂

Thanks in advance!
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
Next page

Similar Threads

Returning Service result to Controller (Minimal API)
C#CC# / help
17mo ago
❔ Error Result View
C#CC# / help
3y ago
Discrepancy between the console result and the expected result.
C#CC# / help
11mo ago
❔ Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse'
C#CC# / help
3y ago