コード例 #1
0
        public async Task <IActionResult> GetEvent(Guid id)
        {
            //vanuit repo één event halen adhv id
            var eventobj = await _context.GetAsync(id);

            if (eventobj == null)
            {
                _logger.LogCritical($"event not found: {id} is not a valid id");
                return(NotFound());
            }
            //opgehaalde event mappen naar een EventDTO
            return(Ok(_mapper.Map <Event, EventDTO>(eventobj)));
        }
コード例 #2
0
        // GET: Event/Details/5
        public async Task <ActionResult> Details(Guid id)
        {
            var eventobj = await eventRepo.GetAsync(id);

            return(View(eventobj));
        }
コード例 #3
0
        // GET: api/Events/5
        public async Task <Event> GetEvent(int id)
        {
            var e = await _eventRepo.GetAsync(id);

            return(e);
        }