Solved

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

Posted on 2017-01-25
2
46 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 63

Accepted Solution

by:
Fernando Soto earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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