Пример #1
0
        public async Task InsertEmojiAsync(LogEmoji emoji)
        {
            using (var connection = new SqliteConnection(_configuration.ConnectionString))
            {
                var sb = new StringBuilder();
                sb.Append(" INSERT INTO LogEmoji ");
                sb.Append(" (Username, EmojiId, MessageTimestamp, IsReaction) ");
                sb.Append(" VALUES (@Username, @EmojiId, @MessageTimestamp, @IsReaction) ");

                await connection.ExecuteAsync(sb.ToString(), emoji);
            }
        }
Пример #2
0
        public async Task RemoveEmojiAsync(LogEmoji emoji)
        {
            using (var connection = new SqliteConnection(_configuration.ConnectionString))
            {
                var sb = new StringBuilder();
                sb.Append(" DELETE FROM LogEmoji ");
                sb.Append(" WHERE EmojiId = @EmojiId ");
                sb.Append(" AND Username = @Username ");
                sb.Append(" AND MessageTimestamp = @MessageTimestamp ");
                sb.Append(" AND IsReaction = @IsReaction ");

                await connection.ExecuteAsync(sb.ToString(), emoji);
            }
        }