Exemplo n.º 1
0
 public void Create(Category category)
 {
     try
     {
         db.Categories.Add(category);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception("Error : " + ex.Message);
     }
 }
Exemplo n.º 2
0
 public void Create(Author author)
 {
     try
     {
         db.Authors.Add(author);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception("error : " + ex.Message);
     }
 }