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(); }
public async Task <IActionResult> ChangeEventStatus([FromBody] UpdateEventStatusCommand command) { await _eventService.UpdateEventStatus(command); return(Ok()); }