Reputation: 5537
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
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