Beispiel #1
0
 public Venue(Id id, Version version, VenueName name, Address address, VenueMap map, Contact contact) : base(id, version)
 {
     this.address = address;
     this.contact = contact;
     this.map     = map;
     this.name    = name;
 }
Beispiel #2
0
 public VenueDocument(Id id, Version version, VenueName venueName, Address address, VenueMap venueMap, Contact contact)
 {
     Id           = (Guid)id;
     Version      = (int)version;
     VenueName    = (string)venueName;
     Address      = (string)address;
     VenueMap     = (string)venueMap;
     VenueContact = (string)contact;
 }
 public UpdateVenueCommand(Guid id, string venueName, string address, string mapURN, string contact, int version)
 {
     Id = new Id(id);
     Address = Address.Parse(address);
     Contact = Contact.Parse(contact);
     VenueMap = new VenueMap(new Uri(mapURN != null ? mapURN : "http://maps.google.co.uk"));
     VenueName = new VenueName(venueName);
     Version = new Version(version);
 }
Beispiel #4
0
 public UpdateVenueCommand(Guid id, string venueName, string address, string mapURN, string contact, int version)
 {
     Id        = new Id(id);
     Address   = Address.Parse(address);
     Contact   = Contact.Parse(contact);
     VenueMap  = new VenueMap(new Uri(mapURN != null ? mapURN : "http://maps.google.co.uk"));
     VenueName = new VenueName(venueName);
     Version   = new Version(version);
 }
Beispiel #5
0
 public VenueDocument(Id id, Version version, VenueName venueName, Address address, VenueMap venueMap, Contact contact)
 {
     Id = (Guid)id;
     Version = (int) version;
     VenueName = (string) venueName;
     Address = (string) address;
     VenueMap = (string) venueMap;
     VenueContact = (string) contact;
 }
Beispiel #6
0
 public SpeakerDocument(Id id, Version version, SpeakerBio bio, PhoneNumber phoneNumber, EmailAddress emailAddress, SpeakerName name)
 {
     Bio = (string) bio;
     Email = (string) emailAddress;
     Id = (Guid) id;
     PhoneNumber = (string) phoneNumber;
     Name = (string) name;
     Version = (int)version;
 }
 public SpeakerDocument(Id id, Version version, SpeakerBio bio, PhoneNumber phoneNumber, EmailAddress emailAddress, SpeakerName name)
 {
     Bio         = (string)bio;
     Email       = (string)emailAddress;
     Id          = (Guid)id;
     PhoneNumber = (string)phoneNumber;
     Name        = (string)name;
     Version     = (int)version;
 }
Beispiel #8
0
 public override void Load(MeetingDocument document)
 {
     id          = new Id(document.Id);
     version     = new Version(document.Version);
     meetingDate = new MeetingDate(document.MeetingDate);
     speaker     = new Id(document.Speaker);
     state       = document.State;
     tickets     = new Tickets(document.Tickets);
     venue       = new Id(document.Venue);
 }
Beispiel #9
0
 public MeetingDocument(Id meetingId, MeetingDate meeting, Id venue, Id speaker, IEnumerable<MeetingDocumentTickets> tickets, MeetingState state, Version version)
 {
     Id = (Guid) meetingId; 
     Venue = venue ?? Guid.Empty;
     MeetingDate = (DateTime) meeting;
     Speaker = speaker ?? Guid.Empty;
     State = MeetingState.Live;
     Tickets = tickets.ToList();
     Version = (int) version;
 }
Beispiel #10
0
        public Version Lock(Version expectedVersion)
        {
            if (expectedVersion != version)
            {
                throw new InvalidOperationException(string.Format("The version is out of date and cannot be updated. Expected {0} was {1}", expectedVersion, version));
            }

            version++;

            return(version);
        }
Beispiel #11
0
 public Meeting(MeetingDate meetingDate, Id venue, Id speaker, Tickets tickets, Version version, Id id)
     : base(id, version)
 {
     this.meetingDate = meetingDate;
     this.venue       = venue;
     this.speaker     = speaker;
     this.tickets     = tickets;
 }
Beispiel #12
0
 public MeetingDocument(Id meetingId, MeetingDate meeting, Id venue, Id speaker, IEnumerable <MeetingDocumentTickets> tickets, MeetingState state, Version version)
 {
     Id          = (Guid)meetingId;
     Venue       = venue ?? Guid.Empty;
     MeetingDate = (DateTime)meeting;
     Speaker     = speaker ?? Guid.Empty;
     State       = MeetingState.Live;
     Tickets     = tickets.ToList();
     Version     = (int)version;
 }
Beispiel #13
0
 protected AggregateRoot(Id id, Version version)
 {
     this.id      = id;
     this.version = version;
 }
Beispiel #14
0
 public Venue(Id id, Version version, VenueName venueName)
     : this(id, version, venueName, new Address(), new VenueMap(), new Contact())
 {
 }
Beispiel #15
0
 public Venue(Version version, VenueName name, Address address, VenueMap map, Contact contact)
     : this(new Id(), version, name, address, map, contact)
 {
 }