Last active
August 29, 2015 14:08
-
-
Save codescribler/26e3c10daef879e81342 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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