public void SaveTextField(TextField entity) { if (entity.Id == default) { _context.Entry(entity).State = EntityState.Added; } else { _context.Entry(entity).State = EntityState.Modified; } _context.SaveChanges(); }
public void SaveNewsItem(NewsItem entity) { if (entity.Id == default) { _context.Entry(entity).State = EntityState.Added; } else { _context.Entry(entity).State = EntityState.Modified; } _context.SaveChanges(); }