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