public JsonResult DestroyAuthor([DataSourceRequest] DataSourceRequest request, AuthorViewModel author)
        {
            Author authorsFromDb = this.Data.Authors.Find(author.Id);

            foreach (var book in authorsFromDb.Books.ToList())
            {
                this.Data.Books.Remove(book);
            }

            this.Data.Authors.Remove(authorsFromDb);
            this.Data.SaveChanges();

            return Json(new[] { author }.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
        public JsonResult CreateAuthor([DataSourceRequest] DataSourceRequest request, AuthorViewModel author)
        {
            if (author != null && ModelState.IsValid)
            {
                var dbAuthor = new Author()
                {
                   Name=author.Name
                };

                this.Data.Authors.Add(dbAuthor);
                this.Data.SaveChanges();
            }
            return Json(new[] { author }.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }