Example #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;
 }
Example #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);
 }
Example #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);
 }
Example #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;
 }
Example #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;
 }
Example #7
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;
 }
Example #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);
 }
Example #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;
 }
Example #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);
        }
Example #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;
 }
Example #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;
 }
Example #13
0
 protected AggregateRoot(Id id, Version version)
 {
     this.id      = id;
     this.version = version;
 }
Example #14
0
 public Venue(Id id, Version version, VenueName venueName)
     : this(id, version, venueName, new Address(), new VenueMap(), new Contact())
 {
 }
Example #15
0
 public Venue(Version version, VenueName name, Address address, VenueMap map, Contact contact)
     : this(new Id(), version, name, address, map, contact)
 {
 }