Esempio n. 1
0
        public async Task <IActionResult> GetEvent([FromRoute] string id)
        {
            if (!ModelState.IsValid)
            {
                _logger.LogInformation(LoggingEvents.ItemNotValid, "Item is not valid");

                return(BadRequest(ModelState));
            }

            var @event = await _service.GetById(id);

            if (@event == null)
            {
                _logger.LogInformation(LoggingEvents.GetItemNotFound, "Item not exists");

                return(NotFound());
            }

            return(Ok(@event));
        }