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(); }
public void Create(Article article) { this.articles.Add(article); this.articles.SaveChanges(); }