user547794
user547794

Reputation: 14511

Linq to Entity Select, Exclude 1st result row?

I have a Linq to Entity Select statement that is currently returning all rows from the database. Since the 1st row of data contains header information, is it possible to exclude the first row from the result set?

var surveyProgramType = surveyProgramTypeRepository
                        .Find()
                        .OrderBy(x => x.ProgramType);

Upvotes: 0

Views: 1276

Answers (2)

Todd Bellamy
Todd Bellamy

Reputation: 152

var surveyProgramType = surveyProgramTypeRepository
    .Find()
    .OrderBy(x => x.ProgramType).Skip(1);

Upvotes: 1

D Stanley
D Stanley

Reputation: 152501

use .Skip()

var surveyProgramType = surveyProgramTypeRepository
    .Find()
    .OrderBy(x => x.ProgramType)
    .Skip(1);

Upvotes: 10

Related Questions