Skip to content

Instantly share code, notes, and snippets.

@cbcwebdev
Created May 25, 2012 19:04
Show Gist options
  • Save cbcwebdev/2789916 to your computer and use it in GitHub Desktop.
Save cbcwebdev/2789916 to your computer and use it in GitHub Desktop.
public class Calendar : Story
{
private Region _region;
private readonly ISet<Event> _events;
public Calendar(Guid id, Region region)
{
Id = id;
_region = region;
_events = new HashSet<Event>();
}
public Event Schedule(User contributor, EventDetail detail)
{
var @event = EventFactory.Create(this, contributor, detail);
_events.Add(@event);
return @event;
}
}
public class Region : AggregateBase
{
private string _name;
private Boundary _boundary;
public Region(Guid id, string name, Boundary boundary)
{
Id = id;
_name = name;
_boundary = boundary;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment