Example #1
0
 public bool AddAuthor(Author v)
 {
     db.Authors.Add(v);
     if (!Save())
     {
         return false;
     }
     return true;
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }