How is using LINQ related to using classes like Abstract classes?

This is a related question. I have a Patient table and a Doctor table. Suppose they have something in common (as the answer to my related question suggests). So, I create a PatientClass, DoctorClass and I will also have an
abstract BaseClass.

Now, I'm using LINQ to get the data from Patients. For example, I load a patient information. PatientClass relates to a table in the database and I will use LINQ...

Now, do I need the abstract BaseClass?? OR does each class just relate to a table in the database when I use LINQ? No more OO with LINQ??
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.

Carl TawnSystems and Integration DeveloperCommented:
You're still working in an OO environment because you are using your data model to hide the details of transferring Patient and Doctor objects to and from your database. You don't really need an abstract class; the only reason you might is if you wanted methods that could deal with both of those types of objects.

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
CamilliaAuthor Commented:
I've been looking for an example to show how OO works with LINQ and can't find one. For example, in this link below...are steps 10 and 11 correct? for some reason, I thought if i use LINQ, I don't need to use properties or private variables:

do you have an example that can show LINQ along with one OO concept inhertiance or an abstract class?
Carl TawnSystems and Integration DeveloperCommented:
He is only doing steps 10 and 11 because he is calling a stored procedure rather than actually modelling the tables in the database. If he had modelled the tables instead then he would simply have created a new "Register" object and added that to the context.
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

CamilliaAuthor Commented:
Does having properties (get, set) in that example correct?
CamilliaAuthor Commented:
Also, >> have created a new "Register" object and added that to the context.

can you show me how?
Carl TawnSystems and Integration DeveloperCommented:
Yes. The classes created as part of your model are basic data container classes with a properties that map to the columns in the underlying table.

So, as a simple example you might do something like:
// create a data context
NorthwindDataContext db = new NorthwindDataContext();

// create a new product
Product product = new Product();
product.Name = "Sample product";

// add to database

Open in new window

CamilliaAuthor Commented:
thanks so much. I have a coworker (he's the "architect") and said we dont need the properties, etc with LINQ. Thanks for clarifiying this.
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
.NET Programming

From novice to tech pro — start learning today.