Exemple #1
0
        async Task UpdateTotalViewsAsync(File file)
        {
            // Sql query
            const string sql = "UPDATE {prefix}_Files SET TotalViews = {views} WHERE Id = {id};";

            // Execute and return results
            await _dbHelper.ExecuteScalarAsync <int>(sql, new Dictionary <string, string>()
            {
                ["{id}"]    = file.Id.ToString(),
                ["{views}"] = (file.TotalViews += 1).ToString()
            });

            _attachmentStore.CancelTokens(file);
        }