Exemplo n.º 1
0
 public void Update(PieceOfNews pieceOfNews)
 {
     using (var context = new ApplicationDbContext())
     {
         context.Entry(pieceOfNews).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void Add(PieceOfNews pieceOfNews)
 {
     using (var context = new ApplicationDbContext())
     {
         context.News.Add(pieceOfNews);
         context.SaveChanges();
     }
 }