예제 #1
0
 //[Route("book_add")]
 public ActionResult AddBooks()
 {
     Models.BooksModels book = new Models.BooksModels
     {
         AuthorId = library_repo.RetrieveAuthor().FirstOrDefault().AuthorId,
         Added    = System.DateTime.UtcNow,
         BookId   = Guid.NewGuid(),
         BookName = "Mahabharath"
     };
     library_repo.AddBooks(book);
     return(View());
 }
예제 #2
0
 public bool UpdateBooks(Models.BooksModels books)
 {
     _context.Entry(books).State = System.Data.EntityState.Modified;
     _context.SaveChanges();
     return(true);
 }
예제 #3
0
 public bool RemoveBooks(Models.BooksModels books)
 {
     _context.Entry(books).State = System.Data.EntityState.Deleted;
     _context.SaveChanges();
     return(true);
 }
예제 #4
0
 public bool AddBooks(Models.BooksModels books)
 {
     _context.Books.Add(books);
     _context.SaveChanges();
     return(true);
 }