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

            _context.SaveChanges();
        }
Beispiel #2
0
 public void AddAuthor(Author author)
 {
     this._authors.Add(author);
 }