I have a table of "Notes". Notes support one level of streaming β in other words, you can answer a note, but you cannot answer another answer. So the table looks something like this:
CREATE TABLE [dbo].[Notes] (
[NoteId] [uniqueidentifier] ROWGUIDCOL NOT NULL DEFAULT (newid())
CONSTRAINT [PK__Notes]
PRIMARY KEY ([NoteId]),
[ParentNoteId] UNIQUEIDENTIFIER NULL,
[NoteText] NVARCHAR(MAX) NOT NULL,
[NoteDate] DATETIME NOT NULL
)
So, I use Active Subsonic to get all the βparentβ notes:
var allNotes = (from n in Note.All()
where n.ParentNoteId == null
orderby n.NoteDate descending
select n)
.Skip((pageIndex - 1) * pageSize).Take(pageSize);
Next, I just go through IQueryable and populate the general list of notes. Guides:
List<Guid> noteList = new List<Guid>();
foreach (var note in allNotes)
{
noteList.Add(note.NoteId);
}
Finally, I am trying to build a query to get all responses to notes from the original query:
replies = from n in Note.All()
where n.ParentNoteId != null && noteList.Contains(n.ParentNoteId.Value)
select n
The error I get is: "The method" Contains "is not supported." Any ideas?
EDIT: I tried converting the strings to the following strings:
List<String> noteList = new List<String>();
foreach (var note in allNotes)
{
noteList.Add(note.NoteId.ToString());
}
replies = (from n in Note.All()
where n.ParentNoteId != null &&
noteList.Contains(n.ParentNoteId.Value.ToString()) select n);
Same error message as before.