Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
 public virtual void Update(TEntity entity)
 {
     _baseRepository.Update(entity);
 }