public async Task<string> InsertArticleAsync(ArticleModel article) { article.ArticleKey = Guid.NewGuid().ToString("N"); string articleMessage = $"{article.ArticleKey}|{article.Subject}|{article.Content}" + Environment.NewLine; throw new ApplicationException("My Exception"); await WriteLog(articleMessage); return article.ArticleKey; }
public async Task<string> InsertArticle(ArticleModel article) { string articleKey = null; try { articleKey = await ArticleRepository.InsertArticleAsync(article); } catch (Exception ex) { await Logger.WriteErrorLog(ex); throw ex; } return articleKey; }