Exemplo n.º 1
0
        /// <summary>
        /// Edits a teamArticle from the in coming teamArticleDto
        /// </summary>
        /// <param name="teamArticleDto"></param>
        /// <returns></returns>
        public async Task EditTeamArticle(TeamArticleDto teamArticleDto)
        {
            TeamArticle articleToEdit = await _repo.GetTeamArticleById(teamArticleDto.ArticleID);

            articleToEdit.Title     = teamArticleDto.Title;
            articleToEdit.Body      = teamArticleDto.Content;
            articleToEdit.Date      = teamArticleDto.Date;
            articleToEdit.TeamID    = teamArticleDto.TeamID;
            articleToEdit.IsVisible = teamArticleDto.IsVisible;
            _repo.TeamArticles.Update(articleToEdit);
            await _repo.CommitSave();
        }