EF Child class to inherit values from parent class

Hi

i would like my EF classes should inherit the parent class (table). for example. when setting a LINQ variable with child data I should be able too to access the parent data. currently, when I try to access the parent obj it's null.

I'm using .netcore 2


Please advise.
LVL 1
Joseph KrauszCEOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
It would be helpful to see the code you are using.
0
AndyAinscowFreelance programmer / ConsultantCommented:
The parent class of a child class isn't null if the child exists.  What you are attempting in your code is not inheritence if that is your error.
0
Joseph KrauszCEOAuthor Commented:
The correct answer is, Lazy loading or eager loading (i didn't know of those concepts before)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Fernando SotoRetiredCommented:
That is NOT parent child classes but the way in which Linq will load related rows from related tables.
0
AndyAinscowFreelance programmer / ConsultantCommented:
Agreed - nothing to do with what was asked for, even if it does solve the problem.
0
Joseph KrauszCEOAuthor Commented:
This is what i was looking for
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.