Exemplo n.º 1
0
        public async Task <IActionResult> GetAgendaItems(int eventId, string userId)
        {
            try
            {
                var items = await _agendaService.GetAgendaItems(eventId);

                return(Ok(items.Select(i => new
                {
                    i.Description,
                    i.EndDate,
                    i.EventId,
                    i.Id,
                    i.Location,
                    i.StartDate,
                    i.Title,
                    IsUserAgendaItem = i.UserAgendaItems.Any(x => x.UserId == userId),
                    i.TrackAgendaItems
                })));
            }
            catch
            {
                return(BadRequest());
            }
        }