David
David

Reputation: 5537

Subsonic/Linq Not a sequence error what does it mean

Hi I am getting this error. The expression of type 'System.Collections.Generic.IEnumerable`1[System.String]' is not a sequence.

this is my code

_session.All<Sentence>()
        .Select(T => new { Sentence = T, Descriptions = T.Sentence.Split(' ') })
        .Where(S => S.Descriptions .Intersect(words).Any())
        .Select(R => R.Sentence)
        .Distinct();

words is a list of string.

what does not a sequence mean and how do i fix it.

Upvotes: 1

Views: 583

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1500385

EDIT: Okay, now that the question's been corrected...

I suspect this is a Subsonic restriction. You might try this instead:

.Where(S => S.Descriptions.Any(x => words.Contains(x)))

Upvotes: 1

Related Questions