私は基本クラスPostsとを持っておりNotifications、NotesからPhotos継承してPostsいます。Posts から継承されたすべてのオブジェクトを含む単一のリストを単一のList<Post>.
var notes = posts.OfType<Note>();
var photos = posts.OfType<Photo>();
var notifications = posts.OfType<Notification>(); ;
return (from n in notes
select new Stream()
{
id = n.post_id,
value = n.value,
timestamp = n.timestamp,
type = "note"
}).ToList();
もちろん、上記はメモのみを返します。
前もって感謝します。