Nakib
Nakib

Reputation: 4713

How to include more than one class while fetching from database

I want to include two classes while fetching. I know how to do this with one class but I am not sure how to do it with two.

Here I am including Student

var service = dc.service.Include("Student").OrderBy(i => i.id);

I am not sure how to add both Student and Program

Upvotes: 0

Views: 86

Answers (1)

Vsevolod Goloviznin
Vsevolod Goloviznin

Reputation: 12334

You can just chain multiple Include methods.

var service = dc.service.Include("Student").Include("Program").OrderBy(i => i.id);

Upvotes: 1

Related Questions