Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you do a one to many list in .NET CORE?

Posted on 2017-01-25
2
Medium Priority
?
68 Views
Last Modified: 2017-02-07
My task is pretty straightforward, but I don't know how to pull it off.

I need to run a list where I'm grabbing all of the individuals listed in one table and then all the activities those individuals do from another table. So, it looks like this:

table_1.individual_one
     table.2.individual_one_activity
     table.2.individual_one_activity
table_1.individual_two
    table.2.individual_two_activity
    table.2.individual_two_activity

It's your basic one to many relationship and while I know how to do it in another language, I'm new to .NET, hence the basic nature of my question.

The good news is that I'm working in the context of an app that's pretty verbose and is working very well, so I want to hope that I can just mimic some of what's already going on. I think I've found an example, but I would still like some input.

Here's what appears to be a basic list:

 public class DesignPro : Entity
    {
        public string DesignProID { get; set; }
        public List<DesignProD> DesignProfessionalD { get; set; }
    }

Here's what I'm thinking is something similar to what I need, but I don't completely understand it...

 public class DesignProfessionalDiscipline : Entity
    {
        public int DesignProfessionalDId { get; set; }
        public string DesignProLk { get; set; }
        public DesignProfessional DesignProfessional { get; set; }
        public string DisciplineLk { get; set; }
        public Discipline Discipline { get; set; }
        public List<DrawingDesignProfessionalDiscipline> DrawingDesignProfessionalDisciplines { get; set; }
    }

I see "DisciplineDiscipline" and I'm wondering if that's an embedded list of sorts.

Can someone point me in the right direction?
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 41979898
To your statement, "I see "DisciplineDiscipline" and I'm wondering if that's an embedded list of sorts.", no that is not a list it is a single instance of Discipline.
0
 

Author Closing Comment

by:brucegust
ID: 41998837
This has since been resolved, Fernando, but thanks for weighing in!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question