Beispiel #1
0
        public bool SaveBook(BookModel book)
        {
            try
            {
                _rep.Add<BookModel, Book.Data.Book>(book);
                return true;
            }
            catch
            {

                return false;
            }
        }
Beispiel #2
0
 public ActionResult SaveBook(BookModel book)
 {
     var msg = "Book was save";
     try
     {
         _bookService.SaveBook(book);
     }
     catch
     {
         msg = "Error";
     }
     return new JsonResult
     {
         Data = msg,
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     };
 }
Beispiel #3
0
 public BookModel GetBookById(int bookId)
 {
     singleResult = _rep.GetSingle<BookModel, Book.Data.Book>(x => x.BookId == bookId);
     return singleResult;
 }