Skip to content

Instantly share code, notes, and snippets.

@codescribler
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codescribler/26e3c10daef879e81342 to your computer and use it in GitHub Desktop.
Save codescribler/26e3c10daef879e81342 to your computer and use it in GitHub Desktop.
public class CustomerHandler
{
public void Handle(CustomerCreated customer)
{
// Do Insert
DB.Customers.Add(customer.Id, new Customer{Id = customer.Id, Name = customer.Name});
}
}
// ######################
// The messages
public interface IEvent { }
public class CustomerCreated : IEvent
{
public Guid Id { get; set; }
public string Name { get; set; }
}
public class Customer
{
public Guid Id { get; set; }
[Required]
public string Name { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment