From d7e4ebc760a922465df171979ef4c94a7156143f Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Thu, 26 Nov 2020 10:33:05 +0330 Subject: [PATCH] #43 fixing GanjoorAudioId --- RMuseum/Services/Implementation/RecitationService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RMuseum/Services/Implementation/RecitationService.cs b/RMuseum/Services/Implementation/RecitationService.cs index bc6a5e43..b9622fe4 100644 --- a/RMuseum/Services/Implementation/RecitationService.cs +++ b/RMuseum/Services/Implementation/RecitationService.cs @@ -1055,7 +1055,14 @@ namespace RMuseum.Services.Implementation )) { await connection.OpenAsync(); - await connection.ExecuteAsync(sql); + using(MySqlCommand cmd = new MySqlCommand(sql, connection)) + { + await cmd.ExecuteNonQueryAsync(); + int AudioId = (int)cmd.LastInsertedId; + narration.GanjoorAudioId = AudioId; + context.Recitations.Update(narration); + await context.SaveChangesAsync(); + } } tracker.FirstDbUpdated = true;