コード例 #1
0
        public async Task <string> CreateRound(
            string tournamentId,
            RoundType type,
            bool freeform = false
            )
        {
            using (var command = connectionProvider.CreateCommand(@"
                INSERT INTO Round (id, tournamentId, type, freeform)
                VALUES (@id, @tournamentId, @type, @freeform)
            "))
            {
                string id = Guid.NewGuid().ToString();

                command.AddParameter("@id", id);
                command.AddParameter("@tournamentId", tournamentId);
                command.AddParameter("@type", type.ToString().ToLower());
                command.AddParameter("@freeform", freeform);

                await command.ExecuteNonQueryAsync();

                return(id);
            }
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: meany/Banano-Lotto
 public static string GetRoundTypeName(RoundType RoundType)
 {
     return(RoundType.ToString().ToUpper().Replace("PICK", "PICK "));
 }