예제 #1
0
        public async Task <IActionResult> Get(int id, CancellationToken cancellationToken)
        {
            var c = await _eventCollectionRetrievalService
                    .GetCollectionByIdAsync(id, cancellationToken : cancellationToken);

            return(Ok(new EventCollectionDto(c)));
        }
예제 #2
0
        public async Task <IActionResult> Get(int id, CancellationToken cancellationToken)
        {
            try
            {
                var c = await _eventCollectionRetrievalService
                        .GetCollectionByIdAsync(id, cancellationToken : cancellationToken);

                return(Ok(new EventCollectionDto(c)));
            }
            catch (NotFoundException e)
            {
                return(NotFound(e.Message));
            }
        }