public bool AddAuthor(Author v) { db.Authors.Add(v); if (!Save()) { return false; } return true; }
public bool RemoveAuthor(Author v) { if (!db.Authors.Local.Contains(v)) { db.Authors.Attach(v); } db.Authors.Remove(v); if (!Save()) { return false; } return true; }
public bool UpdateAuthor(Author v) { if (!db.Authors.Local.Contains(v)) { db.Authors.Attach(v); } db.Entry<Author>(v).State = EntityState.Modified; if (!Save()) { return false; } return true; }