Skip to content

Instantly share code, notes, and snippets.

@dtryon
Created April 10, 2012 11:20
Show Gist options
  • Save dtryon/2350610 to your computer and use it in GitHub Desktop.
Save dtryon/2350610 to your computer and use it in GitHub Desktop.
NSB publish
public interface IDidSomething
{
int UserID { get; set; }
DateTime EventDate { get; set; }
}
public class Publisher
{
public IBus Bus { get; set; }
public void DoSomething(int userId)
{
Bus.Publish<IDidSomething>(m => {
m.UserID = userId;
m.EventDate = DateTime.UtcNow;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment