//[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()); }
public bool UpdateBooks(Models.BooksModels books) { _context.Entry(books).State = System.Data.EntityState.Modified; _context.SaveChanges(); return(true); }
public bool RemoveBooks(Models.BooksModels books) { _context.Entry(books).State = System.Data.EntityState.Deleted; _context.SaveChanges(); return(true); }
public bool AddBooks(Models.BooksModels books) { _context.Books.Add(books); _context.SaveChanges(); return(true); }