public void SaveAuthor(Author author) { if (author.Id == 0) context.Authors.Add(author); else context.Entry(author).State = EntityState.Modified; context.SaveChanges(); }
public void DeleteAuthor(Author author) { context.Authors.Remove(author); context.SaveChanges(); }
public void AddAuthor(Author author) { context.Authors.Add(author); context.SaveChanges(); }