public VenueDocument(Id id, Version version, VenueName venueName, Address address, VenueMap venueMap, VenueContact venueContact) { Id = (Guid)id; Version = (int) version; VenueName = (string) venueName; Address = (string) address; VenueMap = (string) venueMap; VenueContact = (string) venueContact; }
public SpeakerDocument(Id id, Version version, SpeakerBio bio, PhoneNumber phoneNumber, EmailAddress emailAddress, Name name) { Bio = (string) bio; Email = (string) emailAddress; Id = (Guid) id; PhoneNumber = (string) phoneNumber; Name = (string) name; Version = (int)version; }
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; }
public Meeting Schedule(Id meetingId, MeetingDate on, Id venue, Id speaker, Capacity capacity) { if (on == null) throw new ArgumentNullException("on", "A meeting must have a date to be scheduled"); var tickets = _overbookingPolicy.AllocateTickets(capacity); var meeting = new Meeting(meetingDate: on, venue: venue, speaker: speaker, tickets: tickets, version: new Version(), id: meetingId); meeting.OpenForRegistration(); return meeting; }
public void GivenIHaveAVenue(string venueName) { using (var uow = container.Resolve<IAmAUnitOfWorkFactory>().CreateUnitOfWork()) { venueId = new Id(Guid.NewGuid()); var venue = new VenueDocument( venueId, new Version(), new VenueName("The American Bar, The Savoy Hotel"), new Address(new Street("The Strand"), new City("London"), new PostCode("WC2R 0EU")), new VenueMap(new Uri("http://www.fairmont.com/savoy/MapAndDirections.htm")), new VenueContact(new ContactName("Athena Cripps"), new EmailAddress("*****@*****.**"), new PhoneNumber(" +44 (0)20 7420 2492"))); uow.Add(venue); uow.Commit(); } scheduleMeetingCommand.VenueId = venueId; }
public void GivenIHaveASpeaker(string speakerName) { using (var uow = container.Resolve<IAmAUnitOfWorkFactory>().CreateUnitOfWork()) { speakerId = new Id(Guid.NewGuid()); uow.Add(new SpeakerDocument( speakerId, new Version(), new SpeakerBio("Augusta Ada King, Countess of Lovelace (10 December 1815 – 27 November 1852), born Augusta Ada Byron, was an English writer chiefly known for her work on Charles Babbage's early mechanical general-purpose computer, the analytical engine."), new PhoneNumber("888-888-8888"), new EmailAddress("*****@*****.**"), new Name("Augusta Ada King, Countess of Lovelace"))); uow.Commit(); } scheduleMeetingCommand.SpeakerId = speakerId; }
public bool Equals(Id other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.id.Equals(id); }