public void SaveOrUpdate(Author entity) { if (entity.Id == 0) _context.Authors.Add(entity); else _context.Entry<Author>(entity).State = EntityState.Modified; _context.SaveChanges(); }
public void AddAuthor(Author author) { this._authors.Add(author); }