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