Ejemplo n.º 1
0
        public void UpdateById(int id, Article updateArticle)
        {
            var articleToUpdate = this.articles.GetById(id);

            articleToUpdate.CategoryId = updateArticle.CategoryId;
            articleToUpdate.Title = updateArticle.Title;
            articleToUpdate.Content = updateArticle.Content;

            this.articles.SaveChanges();
        }
Ejemplo n.º 2
0
 public void Create(Article article)
 {
     this.articles.Add(article);
     this.articles.SaveChanges();
 }