Пример #1
0
        public void Edit(Author author)
        {
            var execution =
                MapperAbstraction.ExecuteScalar <int>(Resources.Author.Edit,
                                                      new
            {
                author.IdAuthor,
                author.Name
            });

            if (execution != 1)
            {
                throw new Exception("Coundn't edit the author");
            }
        }
Пример #2
0
        public void Save(Book book)
        {
            book.Id =
                MapperAbstraction.ExecuteScalar <int>(Resources.Book.Insert,
                                                      new
            {
                book.Author.IdAuthor,
                book.Title,
                book.YearPublication
            });

            if (book.Id == 0)
            {
                throw new Exception("Could not save the book");
            }
        }