Exemple #1
0
        // Get a specific slot
        public SlotDTO GetSlot(int slotId)
        {
            var slot = (from s in _slotRepo.GetById(slotId)
                        select new SlotDTO()
            {
                Id = s.Id,
                StartTime = s.StartTime,
                EndTime = s.EndTime,
                Room = new RoomDTO()
                {
                    Id = s.Room.Id,
                    Name = s.Room.Name,
                    ConferenceId = s.Room.ConferenceId
                },
                Presentation = new PresentationDTO()
                {
                    Id = s.PresentationId,
                    ConferenceId = s.Room.ConferenceId,
                    Title = s.Presentation.Title,
                    Description = s.Presentation.Description
                },
                Speaker = new SpeakerDTO()
                {
                    FirstName = s.Speaker.FirstName,
                    LastName = s.Speaker.LastName,
                    Title = s.Speaker.Title,
                    Phone = s.Speaker.Phone,
                    Email = s.Speaker.Email,
                    Company = s.Speaker.Company,
                    CoStreet = "",
                    CoCity = "",
                    CoState = "",
                    CoZip = "",
                    Bio = s.Speaker.Bio,
                    ImageUrl = s.Speaker.ImageUrl,
                    Id = s.Speaker.Id
                }
            }).FirstOrDefault();

            if (slot == null)
            {
                throw new Exception("Could not find slot with id " + slotId);
            }

            return(slot);
        }