Exemple #1
0
        public async Task <ActionResult> CreateDownloadEvent([FromBody] DownloadEvent downloadEvent)
        {
            try
            {
                DownloadEvent createdEvent = await _context.CreateDownloadEvent(downloadEvent);

                return(CreatedAtRoute(nameof(GetEvent), new { id = createdEvent.Id }, createdEvent));
            }
            catch (ControllerNotFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (ControllerBadRequestException e)
            {
                return(BadRequest(e.Message));
            }
        }