public Conference MapGuidebookToConference(GuidebookDto guidebook) { guidebook.ThrowIfNull ("guidebook"); var conference = new Conference (); conference.Sessions = GetConferenceSessions (guidebook); conference.Speakers = GetConferenceSpeakers (guidebook); conference.Tracks = GetConferenceTracks (conference.Sessions); return conference; }
public IList<Session> GetConferenceSessions(GuidebookDto guidebook) { guidebook.ThrowIfNull ("guidebook"); var sessions = new List<Session> (); if (guidebook.Events != null) { foreach (var item in guidebook.Events.Events.Where(t => t != null)) { var session = MapEventDtoToSession (item); sessions.Add (session); } } return sessions; }
public IList<Speaker> GetConferenceSpeakers(GuidebookDto guidebook) { guidebook.ThrowIfNull ("guidebook"); var speakers = new List<Speaker> (); if (guidebook.Speakers != null) { foreach(var item in guidebook.Speakers.Speakers.Where(t => t != null).Distinct()) { var speaker = MapSpeakerDtoToSpeaker (item); speakers.Add (speaker); } } return speakers; }
private GuidebookDto CreateGuidebookDto() { var dto = new GuidebookDto(); dto.Speakers = _fixture.Create <SpeakersDto> (); dto.Events = new EventsDto(); dto.Events.Events = new List <EventDto> { CreateEventDto(), CreateEventDto(), CreateEventDto() }; return(dto); }
private GuidebookDto CreateGuidebookDto() { var dto = new GuidebookDto (); dto.Speakers = _fixture.Create<SpeakersDto> (); dto.Events = new EventsDto (); dto.Events.Events = new List<EventDto> { CreateEventDto(), CreateEventDto(), CreateEventDto() }; return dto; }