Пример #1
0
 public async Task AddMessageAsync(string messageBoardId, GameMessage message)
 {
     try
     {
         var command = new SQLiteCommand("INSERT INTO Messages (MessageBoardId, MessageJson) VALUES (@MessageBoardId, @Json)");
         command.AddParameter("@MessageBoardId", messageBoardId);
         command.AddParameter("@Json", message.Serialize());
         await ExecuteAsync(command);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "An error occurred inserting a message for board '{messageBoardId}'.", messageBoardId);
         throw;
     }
 }