c# - merge items into one that are repeated in the same list -
i have query in database returns me list of objects( in case notifications), list brings lot of repeated items(a notification can contain multiples attachments, query join attachment table, bringing lot of notificationid repeated, notification lot of attachment). want acomplish merge attachments 1 specific notification id 1 item (let notification class has list of attachments) did this:
dim dupes = list.groupby(function(x) x.notification.notifiedid) .select(function(s) s.tolist()) .tolist()
but don't know how merge grouped ones, here?
try in c#
list.groupby(x=> x.notification.notifiedid).selectmany(o=> o);
i don't know vb can try this
dim dupes = list.groupby(function(x) x.notification.notifiedid) .selectmany(function(s) s) .tolist()
Comments
Post a Comment