Ejemplo n.º 1
0
        public void Update(Models.Article article)
        {
            using (var db = new ArticleContext())
            {
                var newarticle = db.Articles.First(a => a.Id == article.Id);

                newarticle.Header = article.Header;
                newarticle.Category = article.Category;

                db.SaveChanges();

            }
        }
Ejemplo n.º 2
0
 public void Save(Models.Article article)
 {
     using (var db = new ArticleContext())
     {
         db.Articles.Add(article);
         db.SaveChanges();
     }
 }