From e66d95ec7aa96fff02602c2e349ca2be7b77f824 Mon Sep 17 00:00:00 2001 From: Francesco Lorenzo D'Amico Date: Mon, 24 Aug 2026 13:41:09 +0200 Subject: [PATCH] Save per entry for no duplicate data --- .../Services/ContactMessageNotificationService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RazorPagesMovie/Services/ContactMessageNotificationService.cs b/RazorPagesMovie/Services/ContactMessageNotificationService.cs index 908a478..ff151a3 100644 --- a/RazorPagesMovie/Services/ContactMessageNotificationService.cs +++ b/RazorPagesMovie/Services/ContactMessageNotificationService.cs @@ -79,6 +79,7 @@ public class ContactMessageNotificationService : BackgroundService if (response.IsSuccessStatusCode) { eintrag.NotificationSent = true; + await context.SaveChangesAsync(stoppingToken); } else { @@ -90,7 +91,5 @@ public class ContactMessageNotificationService : BackgroundService _logger.LogError(ex, "Telegram-Versand fehlgeschlagen für ContactMessage {Id}", eintrag.Id); } } - - await context.SaveChangesAsync(stoppingToken); } -} +} \ No newline at end of file