public async Task <ActionResult> DeleteConfirmed(int id)
        {
            book_author book_author = await db.book_author.FindAsync(id);

            db.book_author.Remove(book_author);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "book_id,C_id,time")] book_author book_author)
        {
            if (ModelState.IsValid)
            {
                db.Entry(book_author).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.C_id    = new SelectList(db.authors, "C_id", "lname", book_author.C_id);
            ViewBag.book_id = new SelectList(db.books, "book_id", "name", book_author.book_id);
            return(View(book_author));
        }
        // GET: book_author/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            book_author book_author = await db.book_author.FindAsync(id);

            if (book_author == null)
            {
                return(HttpNotFound());
            }
            return(View(book_author));
        }
        // GET: book_author/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            book_author book_author = await db.book_author.FindAsync(id);

            if (book_author == null)
            {
                return(HttpNotFound());
            }
            ViewBag.C_id    = new SelectList(db.authors, "C_id", "lname", book_author.C_id);
            ViewBag.book_id = new SelectList(db.books, "book_id", "name", book_author.book_id);
            return(View(book_author));
        }