public string Un_Register(int id) { if (repasitory.GetAll().Where(cb => cb.Id == id).ToList().Count != 0) { repasitory.Delete(id); repasitory.Save(); return($"the category-book with id :{id} is deleted..."); } return("Not Found any cattegory-book to un-register"); }
public string Delete(int id) { if (repasitory.GetAll().Where(c => c.Id == id).ToList().Count != 0) { try { var result = repasitory.Delete(id); repasitory.Save(); return(result); } catch { return("There is a dependency for this category in Book-Category table ...."); } } return("Not found any category with this id for delete"); }
public string Delete(int id) { if (repasitory.GetAll().Where(a => a.Id == id).ToList().Count != 0) { try { var result = repasitory.Delete(id); repasitory.Save(); return(result); } catch { return("There is a dependency for this author in Author-Book table ...."); } } return("Not found any author with this id for delete"); }