public async Task SendArticleEmail(Article article, AspNetUser user, string subject) { string body = article.Article_text; var addLink = new connection_user_article { ArticleId = article.ArticleId, AspNetUserId = user.Id }; _unitOfWork.ArticleRepository.AddConnection(addLink); await _senderService.SendMessage(user.Email, subject, body); await _unitOfWork.SaveChangesAsync(); }
public void AddConnection(connection_user_article connection) { DbContext.connection_user_article.Add(connection); }