messagesByOtherUsername = (From m In messages _
Let otherUser = IIF(m.SenderUsername = username, m.RecipientUsername, m.SenderUsername) _
Group By oUser = otherUser Into mbu = Group _
Select New JsMessagesByUsername { _
.Username = oUser, _
.Messages = mbu.Select(Function(m) New JsMessage { _
.Id = m.MessageId, _
.Sender = m.SenderUsername, _
.Msg = m.MessageContents _
}).ToList() _
}).ToList()
|