Ejemplo n.º 1
0
        public async Task <IActionResult> ChangeStatus(Guid id)
        {
            try
            {
                Season season = await _repository.GetByIdAsync(id);

                if (season == null)
                {
                    return(NotFound());
                }

                season.ChangeStatus();

                await _repository.UpdateAsync(season);

                return(Ok());
            }

            catch (DataStoreException e)
            {
                _logger.LogError(e.Message, e, id);
                return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
            }
        }