Пример #1
0
 public void Add(Post post, string type)
 {
     if (type.Equals("new"))
     {
         _context.Add(post);
     }
     else
     {
         _context.Update(post);
     }
     _context.SaveChanges();
 }
Пример #2
0
 public void Add(Category category, string type)
 {
     if (type.Equals("new"))
     {
         _context.Add(category);
     }
     else
     {
         _context.Update(category);
     }
     _context.SaveChanges();
 }