public async Task InsertAsync(int groupId, string title, string imageUrl, string summary, string body) { var article = new MaterialArticle { GroupId = groupId, ThumbMediaId = string.Empty, Author = string.Empty, Title = title, ContentSourceUrl = string.Empty, Content = body, Digest = summary, ShowCoverPic = !string.IsNullOrEmpty(imageUrl), ThumbUrl = imageUrl, CommentType = CommentType.Block }; var materialId = await _materialArticleRepository.InsertAsync(article); var messageId = await _repository.InsertAsync( new MaterialMessage { GroupId = groupId }, Q.CachingRemove(CacheKey) ); var item = new MaterialMessageItem { MessageId = messageId, MaterialType = MaterialType.Article, MaterialId = materialId, Taxis = 1 }; await _materialMessageItemRepository.InsertAsync(item); }
public async Task <bool> UpdateAsync(MaterialArticle article) { return(await _repository.UpdateAsync(article, Q .CachingRemove(CacheKey) )); }
public async Task <int> InsertAsync(MaterialArticle article) { return(await _repository.InsertAsync(article, Q .CachingRemove(CacheKey) )); }