public static string UpdateBook(Book entity) { Book book = GetBookById(entity.Id); if (book != null) { try { book.Name = entity.Name; book.Description = entity.Description; book.Price = entity.Price; _db.Update(book); return("Ok"); } catch (Exception ex) { throw; } } else { return("Book do not exists"); } }
public virtual void Update(TEntity entity) { _baseRepository.Update(entity); }