public async System.Threading.Tasks.Task Save(Notification notification) { _notificationRepository.Save(notification); try { await _emailService.SendAsync(new IdentityMessage { Body = notification.Text, Destination = notification.User.Email, Subject = "Gigbucket notification" }); } catch (Exception exception) { _logger.Error(exception); } }
public void Save(Notification notification) { _dbContext.Notification.Add(notification); _dbContext.SaveChanges(); }