insertTimestamp=DateTime.UtcNow;try{using(varconnection=newNpgsqlConnection(_connectionString.ConnectionString)){connection.OpenWithRetry();using(varinsertVoteCommand=connection.CreateCommand()){insertVoteCommand.CommandText=@"INSERT INTO votes (candidate, time_cast) VALUES (@candidate, @time_cast)";varcandidate=insertVoteCommand.CreateParameter();candidate.ParameterName="@candidate";candidate.DbType=DbType.String;candidate.Value=team;insertVoteCommand.Parameters.Add(candidate);vartimeCast=insertVoteCommand.CreateParameter();timeCast.ParameterName="@time_cast";timeCast.DbType=DbType.DateTime;timeCast.Value=insertTimestamp;insertVoteCommand.Parameters.Add(timeCast);awaitinsertVoteCommand.ExecuteNonQueryAsync();}}returnContent($"Vote successfully cast for '{team}' at time {insertTimestamp}!");}catch(Exceptionex){// If something goes wrong, handle the error in this// section. This might involve retrying or adjusting// parameters depending on the situation.returnStatusCode((int)HttpStatusCode.InternalServerError,ex);}
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],[],[],[]]