Exemple #1
0
        public async Task UpdateEventStatus(UpdateEventStatusCommand command)
        {
            var gameEvent = await _dbContext.Events.AsNoTracking().FirstOrDefaultAsync(f => f.Id == command.Id);

            if (gameEvent == null)
            {
                throw new HttpStatusCodeException(HttpStatusCode.NotFound);
            }

            gameEvent.Status = command.Status;

            _dbContext.Events.Update(gameEvent);
            await _dbContext.SaveChangesAsync();
        }
Exemple #2
0
        public async Task <IActionResult> ChangeEventStatus([FromBody] UpdateEventStatusCommand command)
        {
            await _eventService.UpdateEventStatus(command);

            return(Ok());
        }