diff --git a/AsbCloudInfrastructure/Services/Email/EmailNotificationTransportService.cs b/AsbCloudInfrastructure/Services/Email/EmailNotificationTransportService.cs index 3a01c33d..2dd225f6 100644 --- a/AsbCloudInfrastructure/Services/Email/EmailNotificationTransportService.cs +++ b/AsbCloudInfrastructure/Services/Email/EmailNotificationTransportService.cs @@ -105,9 +105,9 @@ namespace AsbCloudInfrastructure.Services.Email notification.SentDate = DateTime.UtcNow; - var notificationRepository = serviceProvider.GetService(); + var notificationRepository = serviceProvider.GetRequiredService(); - await notificationRepository!.UpdateAsync(notification, token); + await notificationRepository.UpdateAsync(notification, token); Trace.TraceInformation($"Send email to {notification.User.Email} subj:{notification.Title} html body count {notification.Message.Length}"); };