Created
October 27, 2011 23:20
-
-
Save plioi/1321180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMessage { } | |
public class RemoveOrderLineItem : IMessage { } | |
public class MessageBus | |
{ | |
public void Send(IMessage message) | |
{ | |
//Send the message. | |
} | |
public void SendAll(List<IMessage> messages) | |
{ | |
foreach (var message in messages) | |
Send(message); | |
} | |
} | |
... | |
List<RemoveOrderLineItem> removals = new List<RemoveOrderLineItem>(); | |
removals.Add(new RemoveOrderLineItem()); | |
removals.Add(new RemoveOrderLineItem()); | |
removals.Add(new RemoveOrderLineItem()); | |
var bus = new MessageBus(); | |
bus.SendAll(removals); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment