private Task ProcessModelItemRemoveMessage(RemoteItemRemoveMessage <T> message) { foreach (var item in message.Items) { var resultItem = item.Retrieve(ReceiveContext, LocalContextAction.Delete); Items.Remove(resultItem); } return(TaskDone.Done); }
/// <summary> /// Send message containing removed remote values. /// </summary> /// <param name="remoteValues">Removed remote values.</param> public void EnqueueRemoveRemoteItems(IList <IObjectRemoteValue <T> > remoteValues) { var senderGrouping = remoteValues.GroupBy(GetSenderForValue); foreach (var group in senderGrouping) { var senderMessage = new RemoteItemRemoveMessage <T>(group.ToList()); group.Key.EnqueueMessage(senderMessage); } }