public IActionResult Index() { var conferenceViewModels = _conferenceRepository.Get().Select(c => new ConferenceViewModel { IdConference = c.IdConference, Name = c.Name, Description = c.Description }); return(View(conferenceViewModels)); }
public async Task CreateSeat(SeatType seat) { if (!await _conferenceRepository.CheckExistenceById(seat.ConferenceId)) { throw new ApplicationException("Conference record wasn't found!"); } await _seatRepository.AddConferenceSeat(seat); var conference = await _conferenceRepository.Get(seat.ConferenceId); // Don't publish new seats if the conference was never published // (and therefore is not published either). if (conference.WasEverPublished) { _hostServiceBus.Publish <ISeatCreated>(new SeatCreated(seat)); } }
public SpeakerController(ISpeakerRepository speakerRepository, IConferenceRepository conferenceRepository) { _speakerRepository = speakerRepository; _conferences = conferenceRepository.Get().ToList(); }
public ConferenceDto Get(int id) { var conference = _conferenceRepository.Get(id); return(_mapper.Map <ConferenceDto>(conference)); }
public IEnumerable <ConferenceViewModel> Get() { return(_conferenceRepository.Get().Select(s => s.ToViewModel())); }