public void Add(Post post, string type) { if (type.Equals("new")) { _context.Add(post); } else { _context.Update(post); } _context.SaveChanges(); }
public void Add(Category category, string type) { if (type.Equals("new")) { _context.Add(category); } else { _context.Update(category); } _context.SaveChanges(); }