Skip to content

Instantly share code, notes, and snippets.

@codescribler
Created November 13, 2014 22:08
Show Gist options
  • Save codescribler/448a58a2e5fc9bc7ed34 to your computer and use it in GitHub Desktop.
Save codescribler/448a58a2e5fc9bc7ed34 to your computer and use it in GitHub Desktop.
A simplified aggregate root
public abstract class AggregateRoot
{
private readonly List<Event> _changes = new List<Event>();
public abstract Guid Id { get; }
public int Version { get; internal set; }
public IEnumerable<Event> GetUncommittedChanges()
{
// Removed for clarity
}
public void MarkChangesAsCommitted()
{
// Removed for clarity
}
public void LoadsFromHistory(IEnumerable<Event> history)
{
// Removed for clarity
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment