public async Task <IActionResult> Vote(int id) { try { await queueClient.SendVoteAsync(id); return(this.Ok()); } catch (Exception ex) when(ex is VoteQueueException) { logger.LogError(ex, "Exception sending vote to the queue"); return(BadRequest("Bad Request")); } }
public async Task <IActionResult> Vote(int id) { try { var data = new { Id = id }; await queueClient.SendVoteAsync(JsonConvert.SerializeObject(data)); return(this.Ok()); } catch (Exception ex) when(ex is VoteQueueException) { logger.LogError(ex, "Exception sending vote to the queue"); return(BadRequest("Bad Request")); } }